Button movies

i’ve seen this done on a lot of sites http://www.methodengine.com/V1/index_set.html is just one example. when you rollOver the button the movie plays forward then when you roll off it plays backwards now this is easy to do if the user stays in the rollOver state for the duration of the animation but if you rollOut in the middle of the animation it would jump. this movie doesnt … it plays from the exact same spot almost like they tell the movie to play backwards from the frame it is on when the rollOut action occurs. how do they do that?

thx

Wow! That’s fantastic… I really have to learn how to use video in MX. And buy a camera :frowning:

Anyway, the function you’re looking for is prevFrame(). All you have to do is put an empty movie clip that will

onClipEvent (enterFrame) {if (backwards) _root.yourClip.prevFrame();}

and handle the backwards variable from your button (on rollOver=1, on rollOut=0).

I hope it makes sense.

pom :asian:

right … i understand how to give it a rollOver and rollOut action but i dont understand how to write the (backwards) function. does flash have a function like this?

i’m sorry to be a newb but i really don’t understand how they make the movie seem to play backwards from whatever spot you perform the rollOut action.

Oh, no, backwards is not a function, it’s just a variable name =1 or 0. The function you need is prevFrame()

I made an example.

pom :asian:

That’s a great effect: make a tutorial! :slight_smile:

pom :asian:

:-\ stupid work hasn’t gotten through the 8 year approval process it takes to get new software around here … they gotta make sure flash mx isnt going to break their p.o.s. machines. long story short - i dont have flash mx at work yet. we have flash 5 … so unless you can repost a flash 5 version of that example im going to have to wait 'till tonight when i get home to open it.

thx for the help though … i’m excited to see it.

Oh man… am I going to have to go out and buy Flix? Too many products!!! I just can’t afford them all. :frowning:

Is that done with Flix?

pom :asian:

Hey, Pom… can you translate? I mean… I know what you’re saying here… but how does it translate…

onClipEvent (enterFrame){
if (_root.i) _root.prevFrame();
else _root.nextFrame();
}

why do we need the empty movie clip? (not doubting your code at all…)

is this the same as:

onClipEvent(enterFrame){
if(_root.i==0){
_root.prevFrame();
}else{
_root.nextFrame();
}
}

is that right?

Again, I’m really trying to understand from an a/s perspective. Not knocking your code at all! We’re buds! Right?

Inigo, Inigo… :stuck_out_tongue: If you only read what I’ve been writing with my poor tired hands… http://www.kirupa.com/developer/actionscript/as_tricks.asp
It’s in the simple if…else section.

But basically, it’s what you said. Well, the opposite in fact :slight_smile:

pom :asian: