Movieclip needs to loop but only on prompt

I have an .fla with multiple movieclips. For most of these, as one finishes, it calls the next with code like;

on that next movieclip (the one to be played), the first frame is blank with actionscript stop(); so that it won’t begin at the start of the movie.

nearly every movieclip plays just once and this has worked fine.

I have run into a snag because I want one of these to loop 20 times, and I’m trying to do a loop, but either it plays once and stops or never plays.

this clip should not begin at the outset of the movie, and so like the others above, it has a blank keyframe with a stop(); for frame 1

the loop I was using has in the actions layer in the second frame

and in the last frame of the action layer of the movieclip I had

if (i ==20) {

something is wrong.

I’ve tried the code on a clip that has no first frame stop, and then the code works. But I can’t have this clip playing as the movie begins.

Please help, and PLEASE, since I’m new, tell me whether to put your answer in the main timeline or in the movieclip.

If it loops, means it goes back to FIRST frame where your stop is; you might have understood the problem from your test.
So the solution is really very simple:
in the last frame:

if (i <20) {
gotoAndPlay(2); //2nd frame, so no stop here!

wouldnt you need to put:
i= ++i and not just ++i ??? :-\ just wondering.



oh my… thanks for making me see straight! :-\

fixed it in 2 seconds with your help…