Play entire movie 2 times then stop

last week I learned to play a movieclip a specified number of times then stop.

Now, I need to stop an entire .fla (or, it may become a scene, but for now it’s the only content) after it loops TWO times only.

The .fla has one frame containing graphics and text on separate layers and 4 movieclips on different layers. The movieclips have no actionscript in them right now. They are essentially tweens over staggered times.

In fact, right now there’s no actionscript anywhere in this particular .fla.

How can I play it two times then stop. Also, I need to be able to accomodate further stuff after this… that is, the movie is not yet been completed…it was just a start, but it’s only this part that is completed I need to loop twice.

Please could you let me where the code would go too?

thank you


set a variable in the first frame
myVar +=1;

Then do an if at the end of the animation

if(myVar = 2){

Ok that should work :slight_smile:

I added an actionscript layer, put in your code for the first frame, added a new keyframe in frame2 and put the rest of the code there. I also added blank frames to each of the other layers so all is 2 frames long. it’s not working yet… I used your script verbatim. Is there something I was to attach the variable to? somewhere in the property inspector?

sorry…newbie here…

instead of gotoAndPlay try gotoAndStop(frame#)

This assures it will STOP at that frame, where, even if a stop() action is applied to the frame gotoAndPlay will surpass it and still play the clip.

verbatim? :slight_smile:

I was wondering the same thing.


I used code to count up within the tweened movieclips.
It wouldn’t work on the main timeline, although I suppose I’ve erred somewhere. thanks anyway.

p.s. verbatim… yup…

check it out