PDA

View Full Version : play twice then stop?



linque
August 18th, 2002, 02:12 AM
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 :) :)

Iammontoya
August 18th, 2002, 08:12 AM
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.

linque
August 18th, 2002, 11:26 AM
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

Jubba
August 18th, 2002, 11:48 AM
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()
}