Hey guys I’ve got a simple question: I’ve got a movie clip with stop actions every 30 frames, and I just want to make a “previous” button that will play the clip in reverse, to the previous stop. I know this is elementary but I just can’t seem to figure it out!
You just copy all the frame you have past them after the one you already have. Then select the hole thing you just pasted and right mouse click or “ctrl”+ mouse click if your a Mac user and reverse your frames. Make labels in you movie and sort it out. Or make from every 30 frames a singel movieclip and place all the "30 frames in one"over a couple frames and go back and forth.
Maybe something like this.
var i:Number = 0;
//Make in your movieclip labels like "frameNumb1","frameNumb2","frameNumb3", "......
buttonForward.onPress = function() {
i++;
_root.gotoAndPlay("frameNumb"+i);
};
//This is for going back
buttonBackwards.onPress = function() {
i--;
_root.gotoAndPlay("frameNumb"+i);
};
//Put on each frame a peace of you animation in a single movieclip
//It's a way of goining back
//Or...just without labels works as well
buttonForward.onPress = function() {
i++;
_root.gotoAndPlay(i);
};
buttonBackwards.onPress = function() {
i--;
_root.gotoAndPlay(i);
};
It’s not a prefix sollution but may it will give you an idea.
Later,
20rr0 :bandit:
Way easier…
put a boolean variable on frame 1. Call it “reverse” or whatever suits your fancy and set it to false. Then do an onEnterFrame that checks reverse. If reverse is true, go back a frame.
var reverse:Boolean = false;
this.onEnterFrame = function() {
if (reverse) {
this.prevFrame();
}
// reset reverse on frame 1
if (this._currentframe==1) {
reverse = false;
}
}
When you want it to play back, (on an event, or mouse action, or frame number) just set reverse to true. Put that with every stop frame, changing the reset frame number… or better yet, create an array with the frame number for every stop frame and check that against the current frame.
Thanks guys. My mind boggled when I read yours, 20rr0 lol. Thanks both of you anyway, I’ll try yours now Kame…