play backwards button
- Started
- Last post
- 6 Responses
- Buckyball2
I googled this topic and didn't find much. especially for Flash 8.
what is the easiest way to make a button play an mc on rollover and play that same mc backwards on rollout.
currently i use:
on (rollOver) {
with (aboutbutton) {
gotoAndPlay(2);
}
}
on (rollOut) {
with (aboutbutton) {
gotoAndPlay("out");
}
}
on (release) {
gotoAndPlay(2);
}Which calls an mc on stage with a blank first frame, plays it to a point and then on rollout plays from a frame label which is essentially the same movie backwards.
Painstaking. Easier way?
thanks
- ********0
you could use
myMovieClip.nextFrame()
and
myMovieClip.previousFrame()
want an example?
- chrisRG0
make you button a MC, make you animation inside it, and put a stop(); at the 1st and at the last frame, then put this actions on your MC:
on (rollOver, dragOver) {
this.onEnterFrame = function() {
if (this._currentframe != this._totalframes) {
this.nextFrame();
} else {
delete this.onEnterFrame;
}
};
}
on (releaseOutside, rollOut, dragOut) {
this.onEnterFrame = function() {
if (this._currentframe != 1) {
this.prevFrame();
} else {
delete this.onEnterFrame;
}
};
}
on (release) {
// release
}
- Buckyball20
Yes an example would be nice.
thanks.
- Buckyball20
that code worked just fine chris. thanks.
- beedee0
this may be more complicated than you're looking for, but i use lmc_tween's frameTo() function for stuff like that. so it would just be:
on(rollOver){
mc.play();
}on(rollOut){
mc.frameTo(1);
}if you don't know what i'm talking about, go here:
- ********0
a good way indeed of doing it...
You can make it better by not having your code on the MovieClips though ;) Also Flash 8 has its own tween Class.. MX2004 too I think..
myClip_mc.onRollOver = function()
{
mc.play
}myClip_mc.onRollOver = function()
{
mc.frameTo(1);
}