9 Replies Latest reply on Feb 9, 2007 1:59 PM by Newsgroup_User

    script cast member not found

    Level 7
      Can anyone tell me why the %^$& I get a "script cast member not found"
      error?

      I've been working in Director for 17 years and I get this from time to time.
      I generally just copy the code from the behavior, paste it into a new
      behavior, name the new one the same as the old on, then copy the new cast
      member over the old one and it solves it. But it happened rarely enough
      that I didn't bother questioning why. I know it's not a syntax error
      because the code runs fine after the above process. But it does only
      happens when I've made a change to the code in that behavior.

      Now I'm working with a simple movie with one parent script and a
      prepareMovie handler that instantiates one child object and I'm getting this
      darn error all the time. My above solution isn't working anymore. The
      error points to the first line of a particular handler. That first line was
      a comment. So I got rid of the comment and the new first line of the
      handler is code and the error points to it. If you see where I'm headding,
      no matter how many lines of "errored" code I get rid of the error alert will
      always point to the first line of that handler.

      I'm sure many have seen this because it's happened in almost every version
      of Director I've owned. And by the way, I'm in MX on a PC.

      --
      Craig Wollman
      Lingo Specialist
      Word of Mouth Productions
      212-928-9581

      www.wordofmouthpros.com


        • 1. Re: script cast member not found
          Level 7
          Hi Craig,

          Could it be a simple mistake of the script type not being properly defined
          (movie/parent/behavior)?

          If you have a very baic movie where this error occurs repeatedly, you could
          email me (d.utian@unsw.edu.au) and I'll take a fresh perspective look at it.

          regards
          Dean

          Director Lecturer / Consultant
          http://www.fbe.unsw.edu.au/learning/director
          http://www.multimediacreative.com.au




          • 2. Re: script cast member not found
            Level 7
            Dean, I might do that. No, this has been going on long enough that I sure
            it's not any definable user error.

            But, I did, after all of these years, discover something last night. In one
            case, I did get a legitimate script error that I fixed. When I ran the
            project again, I received the same script error, even though it was a simple
            fix and I was sure I corrected it. I recompiled several times and ran it
            again and received the error again. Then it dawned on me that since parent
            scripts remain in memory until disposed of, Director must have been, for
            some reason, referring to the old parent script. I had already set the
            object's global variable to 0 in my stopMovie handler and even though that
            handler might not always run when errors occur, I ran it from the message
            window to insure that the object's global was 0. But that still didn't
            solve the problem. Then I used clearGlobals in the message window and
            voila, the issue went away. Dare I say that this is a shortcoming of
            Lingo's design to allow variables to persist/linger after an error?

            But what still baffles me is that most of the time when I get that
            particular error,, even though I seemed to have found a workaround, it is
            not an actual issue with any code.

            When it happens again, I'll send you the code. Obviously, if I'm correct
            about the scripts lingering in memory, then you won't receive the error when
            you run the movie.

            I just find it interesting that there haven't been a bunch of "Yeah, I get
            that darn thing too" here.

            Craig

            --
            Craig Wollman
            Lingo Specialist
            Word of Mouth Productions
            212-928-9581

            www.wordofmouthpros.com
            "Dean Utian" <d.utian@unsw.edu.au> wrote in message
            news:45CC1372.D4453911@unsw.edu.au...
            > Hi Craig,
            >
            > Could it be a simple mistake of the script type not being properly defined
            > (movie/parent/behavior)?
            >
            > If you have a very baic movie where this error occurs repeatedly, you
            > could
            > email me (d.utian@unsw.edu.au) and I'll take a fresh perspective look at
            > it.
            >
            > regards
            > Dean
            >
            > Director Lecturer / Consultant
            > http://www.fbe.unsw.edu.au/learning/director
            > http://www.multimediacreative.com.au
            >
            >
            >
            >


            • 3. Re: script cast member not found
              Level 7
              "forum.macromedia.com" <lingoboy@wordofmo.com> posted in
              macromedia.director.lingo:

              > Then it dawned on me that since parent
              > scripts remain in memory until disposed of, Director must have been, for
              > some reason, referring to the old parent script. I had already set the
              > object's global variable to 0 in my stopMovie handler and even though that
              > handler might not always run when errors occur, I ran it from the message
              > window to insure that the object's global was 0. But that still didn't
              > solve the problem.

              Any chance there are other references to the object, for instance, has it
              been added to the actorList?

              I recall reading somewhere that it was a good idea to have the object clear
              its variables before getting destroyed.

              In my case, I usually have an mDestroy() method in the script that clears its
              variables and removes itself from the actorList (if applicable).

              Once mDestroy() runs, if I have the object in a global or other variable,
              then I set that variable to void or 0.



              --
              Mark A. Boyd
              Keep-On-Learnin' :)
              • 4. Re: script cast member not found
                Level 7
                Yes, it's possible it was still in the actorList. I set the actorList to []
                in my stopMovie but again, if stopMovie doesn't run because of a syntax
                error then the actorList would still be populated.

                So, what you're saying jives with what I was saying about persistence. I'm
                used to dealing with this with MIAW's staying in memory even though their
                global reference might have been set to zero, but I just didn't think of
                that with child objects and the actorList but I suppose there's not much
                difference there.

                I'm still surprised that I didn't get more responses of developers running
                into this.

                Thanks to both for your help.

                --
                Craig Wollman
                Lingo Specialist
                Word of Mouth Productions
                212-928-9581

                www.wordofmouthpros.com
                "Mark A. Boyd" <mblist@sanDotrr.com.invalid> wrote in message
                news:Xns98D286F07A9B4mblistssanDotrrcom@216.104.212.96...
                > "forum.macromedia.com" <lingoboy@wordofmo.com> posted in
                > macromedia.director.lingo:
                >
                >> Then it dawned on me that since parent
                >> scripts remain in memory until disposed of, Director must have been, for
                >> some reason, referring to the old parent script. I had already set the
                >> object's global variable to 0 in my stopMovie handler and even though
                >> that
                >> handler might not always run when errors occur, I ran it from the message
                >> window to insure that the object's global was 0. But that still didn't
                >> solve the problem.
                >
                > Any chance there are other references to the object, for instance, has it
                > been added to the actorList?
                >
                > I recall reading somewhere that it was a good idea to have the object
                > clear
                > its variables before getting destroyed.
                >
                > In my case, I usually have an mDestroy() method in the script that clears
                > its
                > variables and removes itself from the actorList (if applicable).
                >
                > Once mDestroy() runs, if I have the object in a global or other variable,
                > then I set that variable to void or 0.
                >
                >
                >
                > --
                > Mark A. Boyd
                > Keep-On-Learnin' :)


                • 5. Re: script cast member not found
                  Level 7
                  "forum.macromedia.com" <lingoboy@wordofmo.com> posted in
                  macromedia.director.lingo:

                  > Yes, it's possible it was still in the actorList. I set the actorList
                  > to [] in my stopMovie but again, if stopMovie doesn't run because of a
                  > syntax error then the actorList would still be populated.

                  In cases like that, during authoring, you can simply run stopMovie from the
                  message window. I do that all the time, though I don't actually use
                  stopMovie. (I have a handler in a movie script that does the clean up
                  actions.)


                  --
                  Mark A. Boyd
                  Keep-On-Learnin' :)
                  • 6. Re: script cast member not found
                    Level 7
                    "Mark A. Boyd" <mblist@sanDotrr.com.invalid> posted in
                    macromedia.director.lingo:

                    > "forum.macromedia.com" <lingoboy@wordofmo.com> posted in
                    > macromedia.director.lingo:
                    >
                    >> Yes, it's possible it was still in the actorList. I set the actorList
                    >> to [] in my stopMovie but again, if stopMovie doesn't run because of a
                    >> syntax error then the actorList would still be populated.
                    >
                    > In cases like that, during authoring, you can simply run stopMovie from
                    > the message window. I do that all the time, though I don't actually use
                    > stopMovie. (I have a handler in a movie script that does the clean up
                    > actions.)

                    Oh, and I forgot to mention that my new() handler in parent scripts that get
                    added to the Actorlist call their own mDestroy() method, thereby
                    removing themselves from the actorList before reinitiating their variables
                    and adding themselves to the actorList again.

                    Did that make sense?

                    So, assuming I'm using a global variable for the object, I can edit that
                    script, then in the message window:

                    gSomeVar = obj_someScript

                    The actorList will have only one reference to a new instance of the object
                    (previous instance was removed) and the object itself will have only two
                    references to it - gSomeVar and the actorList (plus whatever you use to see
                    the object reference count. ie: 'put gSomeVar' will actually show 3
                    references).


                    --
                    Mark A. Boyd
                    Keep-On-Learnin' :)
                    • 7. Re: script cast member not found
                      Level 7
                      "Mark A. Boyd" <mblist@sanDotrr.com.invalid> posted in
                      macromedia.director.lingo:

                      > gSomeVar = obj_someScript

                      Heh. Proper syntax should be assumed there. I'm not on my Dev machine at the
                      moment.


                      --
                      Mark A. Boyd
                      Keep-On-Learnin' :)
                      • 8. Re: script cast member not found
                        Level 7
                        Yes, I've done that for many situations when errors occur. On a side note,
                        did you know that the stopMovie handler doesn't run when you use
                        CNTRL-period on the PC to stop a movie?

                        That one drove me crazy about 8 or 9 years ago.

                        --
                        Craig Wollman
                        Lingo Specialist
                        Word of Mouth Productions
                        212-928-9581

                        www.wordofmouthpros.com
                        "Mark A. Boyd" <mblist@sanDotrr.com.invalid> wrote in message
                        news:Xns98D28B0FA777FmblistssanDotrrcom@216.104.212.96...
                        > "forum.macromedia.com" <lingoboy@wordofmo.com> posted in
                        > macromedia.director.lingo:
                        >
                        >> Yes, it's possible it was still in the actorList. I set the actorList
                        >> to [] in my stopMovie but again, if stopMovie doesn't run because of a
                        >> syntax error then the actorList would still be populated.
                        >
                        > In cases like that, during authoring, you can simply run stopMovie from
                        > the
                        > message window. I do that all the time, though I don't actually use
                        > stopMovie. (I have a handler in a movie script that does the clean up
                        > actions.)
                        >
                        >
                        > --
                        > Mark A. Boyd
                        > Keep-On-Learnin' :)


                        • 9. Re: script cast member not found
                          Level 7
                          I just read the rest of that last post. Yes, it makes sense and will be
                          handy, thanks.

                          --
                          Craig Wollman
                          Lingo Specialist
                          Word of Mouth Productions
                          212-928-9581

                          www.wordofmouthpros.com
                          "Mark A. Boyd" <mblist@sanDotrr.com.invalid> wrote in message
                          news:Xns98D28D711CC4DmblistssanDotrrcom@216.104.212.96...
                          > "Mark A. Boyd" <mblist@sanDotrr.com.invalid> posted in
                          > macromedia.director.lingo:
                          >
                          >> "forum.macromedia.com" <lingoboy@wordofmo.com> posted in
                          >> macromedia.director.lingo:
                          >>
                          >>> Yes, it's possible it was still in the actorList. I set the actorList
                          >>> to [] in my stopMovie but again, if stopMovie doesn't run because of a
                          >>> syntax error then the actorList would still be populated.
                          >>
                          >> In cases like that, during authoring, you can simply run stopMovie from
                          >> the message window. I do that all the time, though I don't actually use
                          >> stopMovie. (I have a handler in a movie script that does the clean up
                          >> actions.)
                          >
                          > Oh, and I forgot to mention that my new() handler in parent scripts that
                          > get
                          > added to the Actorlist call their own mDestroy() method, thereby
                          > removing themselves from the actorList before reinitiating their variables
                          > and adding themselves to the actorList again.
                          >
                          > Did that make sense?
                          >
                          > So, assuming I'm using a global variable for the object, I can edit that
                          > script, then in the message window:
                          >
                          > gSomeVar = obj_someScript
                          >
                          > The actorList will have only one reference to a new instance of the object
                          > (previous instance was removed) and the object itself will have only two
                          > references to it - gSomeVar and the actorList (plus whatever you use to
                          > see
                          > the object reference count. ie: 'put gSomeVar' will actually show 3
                          > references).
                          >
                          >
                          > --
                          > Mark A. Boyd
                          > Keep-On-Learnin' :)