Forum: Animation


Subject: Basic Flash loop problem

ADM opened this issue on Jul 09, 2002 ยท 5 posts


kobaltkween posted Wed, 17 July 2002 at 3:09 PM

I believe that the problem is you're trying to handle all the counting at once. You only want to initialize i once, then count. If you put all that in one frame, each time the frame is played, i is initialized again. What you need is a frame that never gets played again to initialize i (say frame one, i=4;), frames of your animation (say frames 2-30) with a decrement on the first frame of the loop (frame 2, i--;) , and then a frame testing to see where to go to (say frame 31, if (i>0) { gotoAndPlay(2); } else {gotoAndPlay (32);}). I haven't tested this, so I'm not sure if that exact code should work, but I think that this would be the best waqy to handle it. If you're still having the problem that is. The one of the major things to remember in Flash is that all the code in a frame is executed at once.