View Full Version : playing a movie clip backward
kayess
April 5th, 2002, 04:26 PM
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.
I am not Jubba
April 5th, 2002, 05:06 PM
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.
ilyaslamasse
April 5th, 2002, 05:56 PM
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]
I am not Jubba
April 5th, 2002, 06:45 PM
oh yeah. :) forgot about that.
kayess
April 10th, 2002, 11:01 AM
oh man you guys are the greatest. this just cut all of my rollover animations in half for the future. I bow to thee.
ilyaslamasse
April 10th, 2002, 02:39 PM
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]
telekinesis
July 28th, 2003, 03:09 PM
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):
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._currentfram e-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:
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...
kode
July 28th, 2003, 04:04 PM
You could use the setInterval action to control the speed at which the MovieClip plays.
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);
... Why are we posting this in Flash 5? :P
jp182
August 4th, 2003, 10:27 PM
[QUOTE]Originally posted by telekinesis
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._currentfram e-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:
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
THANKS!
claudio
August 4th, 2003, 11:23 PM
It didnt work because you didnt define which timeline to play back. Instead oftimelineToReverse.backUp(50);usethis.backUp(50);
jp182
August 5th, 2003, 12:59 AM
THANKS CLAUDIO!!!!!
claudio
August 5th, 2003, 02:28 PM
welcome :thumb:
kh3mical
August 5th, 2003, 10:07 PM
couldnt u just copy the frames and paste them in the timeline then highlight them and go to modify>frames>reverse???
;):)
jp182
August 5th, 2003, 10:49 PM
won't that affect the file size though?
kh3mical
August 5th, 2003, 10:59 PM
meh, probably
Casenote
January 22nd, 2004, 02:11 AM
I am trying this method but it will not reverse it will only go forward (the color bars on the left hand side :) )
I would really appreciate help...
If there is an easier way, or better way to do this, I am also open to that.
Case
Here is a link to the file:
Checkme.fla (http://www.escapegrace.com/flashtest/Checkme.fla)
jp182
January 22nd, 2004, 06:01 PM
are you sure??
i just opened it in my Flash and did a test movie and when i put my mouse over the bars rolled out and when i took it away the bar went back in. It only worked for one color though. Is it suppose to work for all??
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.