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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to play a movie clip backwards

Useful Tips

How to play a movie clip backwards

by  BigBadDave  Posted    (Edited  )
Have you ever wondered how you can play a movie clip backwards, without having to create a reverse set of frames?

Here's how :

1.) Create your movieclip

2.) Add the following actions to the movieclip

[color green]onClipEvent (load) {
stop ();
var speed = 1;
var direction;
}
onClipEvent (enterFrame) {
if (direction == "ff") {
gotoAndStop (_currentframe+speed);
} else if (direction == "rr") {
gotoAndStop (_currentframe-speed);
}
}
[/color]

3.) Add the following actions to your movieclip button

[color green]on (rollOver) {
_root.[color blue]this-movie[/color].direction = "ff";
}
on (rollOut) {
_root.[color blue]this-movie[/color].direction = "rr";
}
[/color]

4.) That's it!! Now you can mouseover your button, and on mouseoff it will play backwards. The mouseoff only plays backwards from the frame it's got to, (instead of jumping to the end frame and playing backwards, if the user has not allowed the full mouseover affect to run)

Regards

Big Bad Dave

[img http://www.byngdesigns.co.uk/tek-tips/spider.gif]
www.byngdesigns.co.uk

davidbyng@hotmail.com
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top