PDA

View Full Version : Help with button animation


Slippy
06-19-2001, 12:12 PM
I have created a rollover button that zooms the graphic larger then stops. When u mouse away it just pops back to the original size which is not the effect i am looking to achieve. Maybe a tip or two on how to make the graphic zoom back to its original size when the mouse leaves the hit area.

Appreciated.

Thanks

aesthete
06-20-2001, 02:09 AM
no problem!

place your zooming graphic in a movie clip. motion tween it from small to big and then back to it's original size. make a new layer in that clip called "ascripts" and put a stop() frame action on that layer above each of your first two key frames (the first normal size and the big one). On the last frame (graphic should be small again) place a gotoAndStop(1) frame action. place that movie in the same timeline as your button and name it something. i'll call it "zoomMC". then on your button put this code:

(lets assume that the big state occurs on frame 20)


on (rollOver) {
if (zoomMC._currentFrame < 20) {
zoomMC.play();
}
else if (zoomMC._currentFrame > 20) {
zoomMC.gotoAndPlay(zoomMC._totalFrames-zoomMC._currentFrame);
}
}
on (rollOut) {
if (zoomMC._currentFrame >= 20) {
zoomMC.play();
}
else if (zoomMC._currentFrame <= 20) {
zoomMC.gotoAndPlay(zoomMC._totalFrames-zoomMC._currentFrame);
}
}

[Edited by Jesse on 06-20-2001 at 12:12 AM]