Reverse animation

Hi all,
i am using a flash movie with two buttons play & pause.
now i need one more button for reverse animation.
It,s about a 3 min animation without using movieclips.
It’s all in a frame animation.
so i need a action script to control the button such that by clicking the button the animation must be play in the same scene but in reverse.
For eg,
if the movie is running in the 100th frame ,if i click the button it should be play in reverse like 100,99.98,97,96…etc.
reply me asp.
it,s a urgent need.
Thanx

Welcome to the forums!
This is what I came up with after searching:

http://www.kirupaforum.com/forums/showthread.php?t=55339

or you can use a simple function such as this:

Reverse = setInterval(function(){prevFrame()},150)

where 150 isthe interval between frames… and this as on your first frame:

clearInterval(Reverse)

…at least that should work - ther may be aa few bugs in it - ive not got access to FMX atm…

regards,

Prophet.

Hi guys,

this is exactly what i want as well.

I have 2 swf files loaded using the loadmovie function. i need the first movie to play backwards only when a button that in on the second movie is pressed. can anyone help me on this…thanks guys

yeah sure

let’s say you load those two movies into the containers “c1” and “c2”.
in c1, the actions for the button to reverse the movie in c2 would be something like

on (release) {
reverse = setInterval(function(){this._parent.c2.prevFrame()},150);
}

and for the button in c2 (to reverse c1) it would be

on (release) {
reverse = setInterval(function(){this._parent.c1.prevFrame()},150);
}

something like that.

just fyi, you may get frame skipping using setInterval. onEnterFrame events would be better suited (since you are dealing with frames of animation that should happen once every frame).

yup I thought so too, just used prophet’s code as an example. and this was a very unnecessary post.

yeah, I figured as much :wink:

hehe
as I said, an unnecessary post. and now I did it again :stuck_out_tongue: