Flash button question
Does anyone know how to make Flash buttons in the style of these on www.newgrounds.com? (The menubar ones) I can make simple buttons that play an animation when rolled over, but how do you make buttons that fade in when rolled over, and then fade out when the pointer is moved off them?
Some specifics: I want to make a Flash button that smoothly starts to glow when rolled over, and then subtly pulses for the duration of the rollover, and then the glow fades out smoothly when the pointer is removed.
Any advice, Flash experts?
Some specifics: I want to make a Flash button that smoothly starts to glow when rolled over, and then subtly pulses for the duration of the rollover, and then the glow fades out smoothly when the pointer is removed.
Any advice, Flash experts?
Comments
on (rollover) {
but_anim._gotoAndPlay('over');
}
on (rollout) {
but_anim._gotoAndPlay('out');
}
...off the top of my head been a while (thank god) since I did flash dev.
your but_anim clip contains the "glow in/glow out" animation, so it's really not all that different from what you said you've done before..
I bet you're thinking that you could code that up right?
remember, it's just flash.. the closet you can get to that is to tint it (which you can with AS)
onclipenterframe {
if(this.testvar == true){ gotoAndPlay(2); }
else { gotoAndPlay(1); }
}
Then for mouseover and mouse out events, you set the testvar to true and false respectively, and this ensures that once your movie has been started (mouseover) it will complete the fade before the next check of testvar, not halfway through.
Step one
Create a pulse movie symbol, this will be the actual gfx of your button. In the first frame put a stop(); action.
Step two
Create a transparent button with a hit area the same size as your movie graphics.
Step three
Make 3 layers on the main timeline, from the bottom up, Movies, Buttons, Actions.
In the actions layer enter the following code for the first frame. (you will only have 1 frame anyway.)
_root.buttonplaying = "none";
step 4
Select your movies layer and drop the pulse movie onto the stage. Then click on the movie on the stage and display the actions pannel. Then enter this code...
onClipEvent (enterFrame) {
if(_root.buttonplaying == "one"){
play();
}
}
step 5
Select the buttons layer, and drop a transparent button over the movie clip. Select it and show the actions panel and enter this code...
on (rollOver) {
_root.buttonplaying = "one";
}
on (rollOut) {
_root.buttonplaying = "none";
}
Repeat steps 4 & 5 for as many buttons as you want, changing the "one" to "two" etc...
pulsebutton.swf
pulsebutton.fla
description : Drop this component on any movieclip to make it animate from frame 1 to _totalFrames when the mouse enters it. The component will animate the clip back again, when the mouse leaves the movieclip. (description from flashcomponents.net)
link to component
Ahh well, too good examples for you to enjoy.
i would whip up a fla for you, but i'm leaving for a short vacation in a couple of hours ...
i could get it done by next weekend if you can wait ... otherwise i suggest going to flashkit for all your flash needs.