# Playing a movie clip backward

**URL:** https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390
**Category:** Uncategorized
**Created:** [April 5, 2002, 9:26pm UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390 "2002-04-05T21:26:52Z")
**Posts on this page:** 15
**Page:** 1

<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: [April 5, 2002, 9:26pm UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/1 "2002-04-05T21:26:52Z")

</div>

I rememer seeing somewhere a tut about playing a movie clip backwards to save frames. the effect is like in the advanced rollover tut, only instead of making half the tween one way then half the other, you make it play one way then use script to play it backwards on rollout. anybody know how to do that?  
I hope that was understandable.

---

<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: [April 5, 2002, 10:06pm UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/2 "2002-04-05T22:06:51Z")

</div>

the only way i can think of (\<\< that means there is an easier way)

if(someCondition){  
prevFrame()  
}

and put that in all the frames. there has to be an easier way though.

---

<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: [April 5, 2002, 10:56pm UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/3 "2002-04-05T22:56:39Z")

</div>

You could also create a new layer that goes from the first to the last frame of your animation, with that code. Something like onClipEvent (enterFrame) {if () \_root.prevFrame ();}  
Doing so, you wouldn’t have to put in all the frames.

pom 0]

---

<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: [April 5, 2002, 11:45pm UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/4 "2002-04-05T23:45:47Z")

</div>

oh yeah. 🙂 forgot about 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: [April 10, 2002, 3:01pm UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/5 "2002-04-10T15:01:14Z")

</div>

oh man you guys are the greatest. this just cut all of my rollover animations in half for the future. I bow to thee.

---

<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: [April 10, 2002, 6:39pm UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/6 "2002-04-10T18:39:23Z")

</div>

Are you sure it’s a good idea ? It might cause some problems, I think. For instance if there are actions in your frames, or in your clips…

pom 0]

---

<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 28, 2003, 7:09pm UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/7 "2003-07-28T19:09:01Z")

</div>

**Reverse Script:**

This script was designed to make it easy for anyone to reverse an animation or Movie Clip. It’s designed for Flash MX so it will not work in Flash 5 or below. All you do is add the following script to your root timeline (Frame 1 or as early as possible):

```auto
Movieclip.prototype.backUp = function(howManyFrames) { 
   this.createEmptyMovieClip('revController', 100); 
   this.revController.howMany = howManyFrames; 
   this.revController.onEnterFrame = function() { 
      if (this._parent._currentframe>1 and this.howMany>0) { 
         this._parent.gotoAndStop(this._parent._currentframe-1); 
         this.howMany--; 
      } else { 
         this.removeMovieClip(); 
      } 
   }; 
};

```

Then all you have to do is, on a button or keyframe, invoke the method and specify which timeline you want to reverse, and how many frames:

```auto
timelineToReverse.backUp(howManyFramesToReverse);

```

Where:  
timelineToReverse is a path to a MovieClip, like \_root, or \_root.someChild.someGrandChild.  
howManyFramesToReverse is a number indicating how many frames to go back. This script will not go back beyond the first frame of any movieclip.

Note that this script uses the enterFrame clip event because it will automatically match the frame rate of the movie. This gives the effect of playing the movieclip backwards at the same frame rate. This script does not allow for reversing at increased speeds (not yet anyway).

Also note that if you call this on the last frame of your movieclip you will have to put a stop() action before it, to ensure the movieclip doesn’t loop before the reverse begins…

---

<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 28, 2003, 8:04pm UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/8 "2003-07-28T20:04:43Z")

</div>

You could use the setInterval action to control the speed at which the MovieClip plays.  
[AS]MovieClip.prototype.backUp = function(FPS, frames) {  
var prev, init, frame;  
prev = function (mc) {  
if (frame++\<frames) mc.prevFrame();  
else clearInterval(init);  
};  
init = setInterval(prev, 1000/FPS, this);  
};  
//  
timelineToReverse.backUp(framesPerSecond, howManyFrames);[/AS]  
… Why are we posting this in Flash 5? 😛

---

<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: [August 5, 2003, 2:27am UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/9 "2003-08-05T02:27:13Z")

</div>

[QUOTE]\*Originally posted by telekinesis \*

```auto
Movieclip.prototype.backUp = function(howManyFrames) { 
   this.createEmptyMovieClip('revController', 100); 
   this.revController.howMany = howManyFrames; 
   this.revController.onEnterFrame = function() { 
      if (this._parent._currentframe>1 and this.howMany>0) { 
         this._parent.gotoAndStop(this._parent._currentframe-1); 
         this.howMany--; 
      } else { 
         this.removeMovieClip(); 
      } 
   }; 
};

```

Then all you have to do is, on a button or keyframe, invoke the method and specify which timeline you want to reverse, and how many frames:

```auto
timelineToReverse.backUp(howManyFramesToReverse);

```

QUOTE]

Hey I put the code in but came up with it did not work, can you guys help me out:

[http://www.mocha-pages.com/links.fla](http://www.mocha-pages.com/links.fla)  
THANKS!

---

<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: [August 5, 2003, 3:23am UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/10 "2003-08-05T03:23:29Z")

</div>

It didnt work because you didnt define which timeline to play back. Instead of[AS]timelineToReverse.backUp(50);[/AS]use[AS]this.backUp(50);[/AS]

---

<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: [August 5, 2003, 4:59am UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/11 "2003-08-05T04:59:18Z")

</div>

THANKS CLAUDIO!!!

---

<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: [August 5, 2003, 6:28pm UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/12 "2003-08-05T18:28:04Z")

</div>

welcome :thumb:

---

<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: [August 6, 2003, 2:07am UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/13 "2003-08-06T02:07:20Z")

</div>

couldnt u just copy the frames and paste them in the timeline then highlight them and go to modify\>frames\>reverse???

;)🙂

---

<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: [August 6, 2003, 2:49am UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/14 "2003-08-06T02:49:41Z")

</div>

won’t that affect the file size though?

---

<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: [August 6, 2003, 2:59am UTC](https://forum.kirupa.com/t/playing-a-movie-clip-backward/2390/15 "2003-08-06T02:59:35Z")

</div>

meh, probably
