# Play twice then stop?

**URL:** <https://forum.kirupa.com/t/play-twice-then-stop/4738>\
**Category:** Uncategorized\
**Created:** [August 18, 2002, 6:12am UTC](https://forum.kirupa.com/t/play-twice-then-stop/4738 "2002-08-18T06:12:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![linque](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/linque/32/50_2.png) [@linque](https://forum.kirupa.com/u/linque)\
**Post date:** [August 18, 2002, 6:12am UTC](https://forum.kirupa.com/t/play-twice-then-stop/4738/1 "2002-08-18T06:12:27Z")

</div>

My movie has several movie clips each on it’s own layer. The main timeline is one frame long. How would I have my entire movie play twice and then stop?

:q::q: thanks in advance 🙂 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 18, 2002, 12:12pm UTC](https://forum.kirupa.com/t/play-twice-then-stop/4738/2 "2002-08-18T12:12:28Z")

</div>

hmm… try this code on your movie clip.

put a blank keyframe over the stopping point you would like in the playing movie. Name that keyframe “stop”.

on your movie, you could put

onClipEvent(enterframe){  
if(\_root.timesplayed==2){  
gotoandstop(“stop”);  
}  
}

Now, on the last frame of your mc (just above it, to do it correctly) Insert another blank keyframe to put actions in, and put this in the actions for that frame:

\_root.timesplayed++

finally, on your main timeline, in frame 1, put

timesplayed=0;

that should do it.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 18, 2002, 3:26pm UTC](https://forum.kirupa.com/t/play-twice-then-stop/4738/3 "2002-08-18T15:26:19Z")

</div>

thank you for your code. I have four movieclips each 210 frames long.

The maintimeline is only one frame. Are you suggesting that I put this code in each movieclip timeline?

Also, are you suggesting that “\_root.timesplayed++?” be on the 211th frame in it’s own layer named actions (since the “stop” frame label will be the 210th)

or are you saying “\_root.timesplayed++” should be in frame 210

OR, if i’m wrong and you meant the code for the main timeline, should all this code and labeling be in frame 1 or are you saying to make a frame 2. ?

thanks again for the help

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 18, 2002, 3:48pm UTC](https://forum.kirupa.com/t/play-twice-then-stop/4738/4 "2002-08-18T15:48:52Z")

</div>

well since you want the movie clips to play twice then stop you would put the code in the timelines of the movieclips

instead of ‘\_root.timesplayed’ try putting just ‘timesplayed’

put this in the 210th Frame

timesplayed++  
if(timesplayed == 2){  
stop()  
}
