Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

animated buttons

Status
Not open for further replies.

jacksplat

Programmer
Jun 19, 2001
67
US
i was wondering how u make animated buttons. i know how to make general mouseover buttons. i'm talking about having a static picture normal, then have it possibly spin when u mouseover, and then static again when u mouseout. ideas or links would be great.
 
There's a couple of ways to do this, I usually go with a combination of a movieClip animation and an invisible button.

First make the animated clip that you want to turn into a button. Put a stop() action in the first frame so that it doesn't play automatically when you put it on the stage. Give this clip the instance name animatedClip for this example.

Place the clip where you want it and then, on the layer above, cover it with an invisible button. This is created by making a button in the usual way but having all of the frames empty except for a filled shape in the hit frame. It therefore doesn't show up when the movie plays because there's nothing in the up frame but still gives you an area that acts like a button (it appears as a semi-transparent shape in the design view so that you can place it accurately).

Assign these actions to the button...

on(rollOver){
_root.animatedClip.gotoAndPlay(2);
}
on(rollOut){
_root.animatedClip.gotoAndStop(1);
}


If you want the animation to loop stick a gotoAndPlay(2) in the last frame to avoid the stop() action you previously placed in the first frame.
 
i'm planning on making a button in flash and then bringing it in to dreamweaver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top