About RollOut

Hi everyone.

I got a problem. I want to make this button I see on many pages.

When I put the mouse over it, it transform to something else (this is not a problem, it’s easily done)

When I REMOVE the mouse from it, It transforms BACK to the original shape??

I haven’t managed to figure this out, though I experimented alot with RollOut and stuff…

I’d appreciate if someone would help me out here!

Thanks!

make the button an MC with the animation in it… then use a hit test to see if the mouse is over it and advance frames… if the hit test is false have it advance to previous frames, like this:


onClipEvent (enterFrame) {
 if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
 this.nextFrame();
 } else {
 this.prevFrame();
 }
}

There are other ways to do more complicated things… but for what you want this should be fine! Good Luck!!

Peace

Hey Ryall, with MX you can put buttons handlers to clips…

And Wolverine, did you check the advanced rollover tutorial? It might help you.

pom :asian:

Wonderful, just wonderful. Worked exactly as I wanted it to! Had no idea Flash could play movies “backward”, as it seem to do with the prev.frame command… awsome.

Thanks alot for helping out! Back to work! :slight_smile:

I have been trying to use this hitTest method of rollover to control other clips but I have been getting problems. Basically I would like another clip to act as the hit area of sorts, and I figured that i would be able to replace:

this.hitTest(_…

with

MyClip.hitTest(_…

but I get errors, can someone tell me what I’m doing wrong?