Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I Get A Flash Movie To Play Forward Then Backward? 1

Status
Not open for further replies.

greeseman

Technical User
Sep 13, 2002
7
US
Is it possible to have a flash movie play forward, then once it reaches the end starts to play backward? I would really like to accomplish this so that I can have a seamless, looping animation that will still be small in file size. Any help is appreciated.

Thanks
Garrett Reese
 
just put this code at the end of your animation frame:

MC.playReverse( true ); // if you want your _parent movie to play after the reverse playing
MC.playReverse( false ); // // if not

and put this code on the main timeline in frame 1

MovieClip.prototype.PlayReverse = function( bContinue ){
this.onEnterFrame = function() {
this.gotoAndStop(this._currentframe - 1);
if (this._currentframe == 1) {
bContinue == true ? delete this.onEnterFrame && _parent.play() : delete this.onEnterFrame && this.stop();
}
}

}

just put this code at the end of your animation frame:

MC.playReverse( true ); // if you want your _parent movie to play after the reverse playing
MC.playReverse( false ); // // if not


_______________________________________
You know you're old if you can remember when bacon, eggs and sunshine were good for you
 
Thanks for your answer but is it possible to be more specific on exact placement of these scripts. I am sorry I am relatively new at this. Thanks.
 
not really

the MC.playReverse(true); statement goes in the last frame of your animation. just change MC to the instance name of your movieclip

the prototype function does not go in this clip but in the main timeline of your movie.

_______________________________________
You know you're old if you can remember when bacon, eggs and sunshine were good for you
 
Instructors! What would we do without them? [sadeyes]

Check the 6th post in this thread:

Posted a zip package you can download, containing 2 reverse .flas. Maybe easier to understand than the above.

Good luck!

Regards,

cubalibre2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top