2 Replies Latest reply on Jul 23, 2007 12:34 PM by Newsgroup_User

    answer to an old question

    Level 7
      Rando Wiltchek was kind enough to provide feedback to me on the issue below.
      I have included his comments and my original post (avec explitives) below
      them.

      -------------------
      From Rando,

      FIRST:

      All I had to do was add a simple

      on prepareMovie
      clearGlobals
      end prepareMovie

      and it never came back!

      AND...

      You made me understand what is going on - director maintains global
      values even after restarting the movie. So if a parent script
      is hooked up with a global value, it's script is not recompiled there.
      Now if you change your code, the script in memory still points at lines
      in your code for debugging, which of course are not correct anymore.
      So if your changes are not in sync with the memory resistent scripts
      anymore, any exception that is thrown from there, points are "random"
      places in your script.
      With the clearGlobals command (which I was not aware of, until you
      wrote about it), these parent scripts are released from memory and
      won't raise exceptions anymore.

      With
      on prepareMovie
      clearGlobals
      end prepareMovie

      I can make sure that it happens every time I restart my movie.

      Regards,
      Rando

      ----------------------------
      Here is my original post

      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


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

      www.wordofmouthpros.com


        • 1. Re: answer to an old question
          Level 7
          Might be better to use:
          on stopMovie
          clearGlobals
          end

          Otherwise, your objects will remain active after you stop the movie - and
          this could cause several problems while authoring.

          "forum.macromedia.com" <lingoboy@wordofmo.com> wrote in message
          news:f7svq1$2q3$1@forums.macromedia.com...
          > Rando Wiltchek was kind enough to provide feedback to me on the issue
          > below. I have included his comments and my original post (avec explitives)
          > below them.
          >
          > -------------------
          > From Rando,
          >
          > FIRST:
          >
          > All I had to do was add a simple
          >
          > on prepareMovie
          > clearGlobals
          > end prepareMovie
          >
          > and it never came back!
          >
          > AND...
          >
          > You made me understand what is going on - director maintains global
          > values even after restarting the movie. So if a parent script
          > is hooked up with a global value, it's script is not recompiled there.
          > Now if you change your code, the script in memory still points at lines
          > in your code for debugging, which of course are not correct anymore.
          > So if your changes are not in sync with the memory resistent scripts
          > anymore, any exception that is thrown from there, points are "random"
          > places in your script.
          > With the clearGlobals command (which I was not aware of, until you
          > wrote about it), these parent scripts are released from memory and
          > won't raise exceptions anymore.
          >
          > With
          > on prepareMovie
          > clearGlobals
          > end prepareMovie
          >
          > I can make sure that it happens every time I restart my movie.
          >
          > Regards,
          > Rando
          >
          > ----------------------------
          > Here is my original post
          >
          > 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
          >
          >
          > --
          > Craig Wollman
          > Lingo Specialist
          > Word of Mouth Productions
          > 212-928-9581
          >
          > www.wordofmouthpros.com
          >


          • 2. Re: answer to an old question
            Level 7
            That would be true if the stopMovie handler actually ran when this syntax
            error comes up. After getting rid of the error dialog, clearGlobals has to
            be run so one would have to go to the message window and type in
            "clearGlobals" and CR for it to be effective. And if the movie was run
            again without doing this the error would keep coming up. That was the
            problem. So having it in the prepareMovie allows the movie to run correctly
            immediately after the error dialog is cleared.


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

            www.wordofmouthpros.com
            "alchemist" <unknown@domain.com> wrote in message
            news:f7t1fd$4ko$1@forums.macromedia.com...
            > Might be better to use:
            > on stopMovie
            > clearGlobals
            > end
            >
            > Otherwise, your objects will remain active after you stop the movie - and
            > this could cause several problems while authoring.
            >
            > "forum.macromedia.com" <lingoboy@wordofmo.com> wrote in message
            > news:f7svq1$2q3$1@forums.macromedia.com...
            >> Rando Wiltchek was kind enough to provide feedback to me on the issue
            >> below. I have included his comments and my original post (avec
            >> explitives) below them.
            >>
            >> -------------------
            >> From Rando,
            >>
            >> FIRST:
            >>
            >> All I had to do was add a simple
            >>
            >> on prepareMovie
            >> clearGlobals
            >> end prepareMovie
            >>
            >> and it never came back!
            >>
            >> AND...
            >>
            >> You made me understand what is going on - director maintains global
            >> values even after restarting the movie. So if a parent script
            >> is hooked up with a global value, it's script is not recompiled there.
            >> Now if you change your code, the script in memory still points at lines
            >> in your code for debugging, which of course are not correct anymore.
            >> So if your changes are not in sync with the memory resistent scripts
            >> anymore, any exception that is thrown from there, points are "random"
            >> places in your script.
            >> With the clearGlobals command (which I was not aware of, until you
            >> wrote about it), these parent scripts are released from memory and
            >> won't raise exceptions anymore.
            >>
            >> With
            >> on prepareMovie
            >> clearGlobals
            >> end prepareMovie
            >>
            >> I can make sure that it happens every time I restart my movie.
            >>
            >> Regards,
            >> Rando
            >>
            >> ----------------------------
            >> Here is my original post
            >>
            >> 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
            >>
            >>
            >> --
            >> Craig Wollman
            >> Lingo Specialist
            >> Word of Mouth Productions
            >> 212-928-9581
            >>
            >> www.wordofmouthpros.com
            >>
            >
            >