1 Reply Latest reply on Sep 15, 2009 10:39 AM by kglad

    Where to put the script?

    waterfall_zen Level 1

      I'm a little confused on the location to put script so we're completely sure it will executed.

      It's my observation that my script has to be at the same frame for the action taking place. I can't just have it in the 1st frame (like people are saying) and expect it work. For example a script works when my menu starts in frame 1. If I move the menu to start in frame 5, the script stops working until I move the script the frame 5 at the same layer of the menu.

      The script does not work after you have a keyframe. It does not carry over, correct?


      What are the general rules on put scripts at?


      Thanks for any suggestions,

        • 1. Re: Where to put the script?
          kglad Adobe Community Professional & MVP

          actionscript executes as soon as the playhead enters the frame that contains the script.  if you have actionscript on frame 1 that references objects that don't exist until frame 5, the script still executes but because your code is referencing undefined objects, those intended objects will not be affected by the script.


          executed actionscript remains in effect for as long as your swf stays open or until some other script deletes, overrides or nulls it.