ADM opened this issue on Jul 09, 2002 ยท 5 posts
ADM posted Tue, 09 July 2002 at 5:48 AM
I bet this is something real basic but I can't seem to find out why this won't work. A 40 frame amination with this action on frame 30 for(i=4;i>0;i--){ gotoAndPlay(1); } I basicly want it to repeat frames 1 to 30 a few times then run on to 40, I have tried putting goto actions after this set but it still doesn't do what I think it should... HELP Please!
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.
saxon posted Fri, 19 July 2002 at 3:33 AM
I'm always really impressed by people who really understand action scripting, I'd have copied the frames and done it all on the timeline. I confess, I'm a low techie...
ADM posted Mon, 22 July 2002 at 9:23 AM
Cheers guys, sorry I didn't reply sooner, I was waiting for the "alert me" email... which never came. cobaltdream I will try that, and let you know how I got on. Saxon, that's what I used to do, but it starts to bloat the file size.
ADM posted Tue, 23 July 2002 at 5:58 AM
Yay it works! I knew it would be a basic wrong assumption I had made, now to learn more... thanks again