flash button
- Started
- Last post
- 7 Responses
- Bullitt
Sounds fuckin stupid, and maybe it is.
But this is driving me nuts.
Need to create a animated button.
with a hover and hover out animation.
Can anyone give me a quick reference to get this done?
Could do a simple button with an animation on hover. but what about hover out?cheers,
- jabblon0
button.onRollOver = function() {
playOverAnim();
}
button.onRollOut = function() {
playOutAnim();
}
that any help to you?
- Bullitt0
you put that action on the button instance?
- fyoucher10
AS2 or AS3?
- Bullitt0
as2
- fyoucher10
1. Create a movieclip (not a button) with two animations inside that come to a stop. At the beginning of each animation add a frame label to a separate layer (create a blank keyframe, select the keyframe, and then in your propoerties inspector, type in a name for the frame). Call these frame labels "rollover" and "rollout" (without the quotes).
2. Give that movieclip an instance name. ( Select the movieclip, then go to your properties inspector and type in a name). For this example, we'll call it "test_btn" (without the quotes).
3. On the same timeline where you added that button to the stage, create a new separate layer and call it "Actions". This is where you'll put your code. Make sure you don't have anything selected. You don't want to add code to the movieclip. You want to add code to the frame. So click off the stage somewhere to deselect everything.
4. Create a blank keyframe on the Actions layer at the same frame number (or later) as to where the moveclip instance is on. So if your movieclip is on frame 1, then you should add code to frame 1. If your movieclip is on frame 65, then you might want to add your code to frame 66.
5. Select the blank keframe in your timeline. Now open up the Actions panel. This is where you add code.
6. Type the following code into the Actions panel:
test_btn.onRollOver = function (): Void
{ this.gotoAndPlay("rollover"); }test_btn.onRollOut = function (): Void
{ this.gotoAndPlay("rollout"); }Now test the movie. That should be it.
- Jordy0
never put it on the button itself! NEVER! Always on the timeline (forget this when you're using eclipse)
Instance names i say, instance names!
- Bullitt0
Thanks for the help people. Got it sorted in the end.
fyoucher1, cheers mate, very helpful guide that.