How to Make a Button in Flash Cs4


Have you ever wondered how to make a button in Flash CS4? In this tutorial, I will teach you how to make a cool button in Adobe Flash CS4.


1 Create an ActionScript 3.0 File and save it.
2 Draw a shape and select it. Next, right click on the object and name it My_btn. Make sure that it is a button symbol type.
3 Click on your new symbol. Select the option "Convert to Symbol...". Then in the properties panel, click where it says "<Instance Name>" and type My_btn.
4 Double click on My_btn. This should open up a new window where you can edit your button. Notice that the timeline has changed now. Now, the timeline says "Up" "Over" "Down" "Hit" This is where you edit how the button reacts to the mouse.
5 Leave the "Up" event the same and copy the "Up" event frame and paste the frame in the "Down" and "Hit" spots. Now, go to the "Over" event and change the color of your button to anything that looks good to you.
6 You can now test your movie. It should be when you roll over the button with your mouse that it changes color and when you click on the button, it changes to your "Hit" color.
7 Now it is time for the code part. This code will make the button change positions in the timeline. Go to frame one and press F9 to open the actions panel and put the following code:
Your Ad Here

stop();
import flash.events.MouseEvent;
My_btn.addEventListener(MouseEvent.CLICK, CursorClick);
My_btn.addEventListener(MouseEvent.MOUSE_OUT, CursorOff);
function CursorClick(event:MouseEvent):void{
gotoAndStop("2");
}
function CursorOff(event:MouseEvent):void{
gotoAndStop(1);
}

8 Create a new keyframe and draw something on frame two.
9 Test your video and have fun!
Read more: wikihow.com/Make-a-Button-in-Flash-Cs4

Comments