# Reverse animation

**URL:** https://forum.kirupa.com/t/reverse-animation/56985
**Category:** Uncategorized
**Created:** [July 9, 2004, 10:13am UTC](https://forum.kirupa.com/t/reverse-animation/56985 "2004-07-09T10:13:05Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![meenatchi](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@meenatchi](https://forum.kirupa.com/u/meenatchi)
#### Post date: [July 9, 2004, 10:13am UTC](https://forum.kirupa.com/t/reverse-animation/56985/1 "2004-07-09T10:13:05Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 9, 2004, 10:30am UTC](https://forum.kirupa.com/t/reverse-animation/56985/2 "2004-07-09T10:30:07Z")

</div>

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

[http://www.kirupaforum.com/forums/showthread.php?t=55339](http://www.kirupaforum.com/forums/showthread.php?t=55339)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 12, 2004, 10:47am UTC](https://forum.kirupa.com/t/reverse-animation/56985/3 "2004-07-12T10:47:51Z")

</div>

or you can use a simple function such as this:

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

```

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

```auto
clearInterval(Reverse)

```

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

regards,

Prophet.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 12, 2004, 3:38pm UTC](https://forum.kirupa.com/t/reverse-animation/56985/4 "2004-07-12T15:38:12Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 12, 2004, 3:47pm UTC](https://forum.kirupa.com/t/reverse-animation/56985/5 "2004-07-12T15:47:49Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 12, 2004, 3:55pm UTC](https://forum.kirupa.com/t/reverse-animation/56985/6 "2004-07-12T15:55:11Z")

</div>

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).

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 12, 2004, 4:00pm UTC](https://forum.kirupa.com/t/reverse-animation/56985/7 "2004-07-12T16:00:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 12, 2004, 4:03pm UTC](https://forum.kirupa.com/t/reverse-animation/56985/8 "2004-07-12T16:03:38Z")

</div>

> [@ScriptFlipper](#):
>
> yup I thought so too, just used prophet’s code as an example.

yeah, I figured as much 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 12, 2004, 4:05pm UTC](https://forum.kirupa.com/t/reverse-animation/56985/9 "2004-07-12T16:05:18Z")

</div>

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