Skip to main content
transistor06
Known Participant
June 27, 2009
Answered

play 2 movie clips in sequence

  • June 27, 2009
  • 1 reply
  • 701 views

Hello everyone,

I am looking for a script that can let me do this:

If I click a button - 1 movie clip will play X number of frames, and then after it completes, a 2nd movie clip will play X number of frames. 

It is important that I can do this in one script in the button. 

Otherwise the easy way to do it would be add a command at the end of the 1st movie clip. Which I don't want to do because I am trying to create a conditional event thingy...

Any help/suggestions would be appreciated.

Thanks

This topic has been closed for replies.
Correct answer kglad

btn.onRelease=function(){

mc1.play();

mc1.onEnterFrame=function(){

if(this._currentframe==this._totalframes){

this.stop();

delete this.onEnterFrame;

mc2.play();

mc2.onEnterFrame=function(){

if(this._currentframe==this._totalframes){

delete this.onEnterFrame;

this.stop();

}

}

}

}

}

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 27, 2009

btn.onRelease=function(){

mc1.play();

mc1.onEnterFrame=function(){

if(this._currentframe==this._totalframes){

this.stop();

delete this.onEnterFrame;

mc2.play();

mc2.onEnterFrame=function(){

if(this._currentframe==this._totalframes){

delete this.onEnterFrame;

this.stop();

}

}

}

}

}

transistor06
Known Participant
June 27, 2009

AWESOME!

thanks!

kglad
Community Expert
Community Expert
June 27, 2009

you're welcome.