2 Replies Latest reply on Aug 17, 2007 7:40 AM by strong_new

    Looping movie clip X number of times and then stop

    strong_new
      For some reason I am having trouble making a movie clip loop X number of times and then stop. The movie clip is on the main timeline and then inside the movie clip (instance name "hotel_MC") I named the frame "start" and added my code to the last keyframe. Attached is my code. Why is this not working? Please help...this is for a client and I'm new at actionscript.
        • 1. Re: Looping movie clip X number of times and then stop
          klintonray
          The following two steps are good practice, but optional:

          add one more layer on top of the current layers in your root timeline

          name that layer actions

          do the same thing in the movieclip that you want to add actionscript to

          it is always good to have actions on a seperate layer

          The problem you are having is that of initialization.

          I am assuming that you have initialized the count variable on the looping movie clip's timeline.

          Each time the playhead gets to the frame where the count variable is initialized, it will re-initialize the variable.

          so on the root timeline, in the first frame of the new actions layer put this:

          _global.count = 0;

          this will set up a global variable that can be referenced from anywere

          then on the first frame of the action's layer in the movieclip timeline put this:

          • 2. Re: Looping movie clip X number of times and then stop
            strong_new Level 1
            Thank you so much!! I really appreciate your help. It worked!