PDA

View Full Version : Looping frames (x - y) 'i' amount of times then proceeding to frames outside loop


Ember~Daze
02-09-2004, 12:21 AM
Hi,

I'm relatively new to Flash and have not done much work with the AS. I was hoping someone here could enlighten me on an area which has been stumping me.

I need to know how to loop (for example) frames 1 to 5, 4 times then continue to frame 6 until the last frame, then go back to frame 1, thus re-entering the loop, etc. I do believe it would involve something like this... but then again I'm a newbie to this so... what do I know :confused: (which is why I wanna learn)

Frame 1:
i=0

Frame 5:
i=i+1
if (i>4) {
gotoAndPlay(6);
} else if (i<4) {
gotoAndPlay(1);
}


Thanks so much
:)

mindlessLemming
02-10-2004, 09:50 AM
My AS is very sketchy, but try changing i=i+1 to i+=1.
They both mean the same thing, but I know for sure that the second one works in ActionScript 1 + 2.

Andrew