Your Ad Here

December 10, 2009

Creating Buttons

Reactions: 
Title : Creating Buttons in Macromedia Flash
Category : Intermediate

In Macromedia Flash making a button is very easy. Here we will learn how to create them.

1- Open Flash and create a new file.

2- Create a desirable shape like a square or a circle on the workspace. Here we are using square shape.

 
 
 
 
 
 
3- Now convert the shape to a button. Select the whole shape and right click on it and select convert to symbol.


4- Give any name what you want, here we are naming it as "button 1". Also set the type to Button.


 
 
 
 
 
 
 
 
 
5- Double click on the button to edit it. You can clearly see that the timeline is now changed. Here the frames are bigger, with names Up, Over, Down and Hit.


Explanation:

Up: When mouse pointer is not on the button
Over: When pointer comes over the button
Down: When mouse left button is pressed


6- Place frame on Over. Right click on "Over" frame and select Insert Key frame.

                                                     OR
Same result can be achieved by selecting the "Over" frame and pressing F6.


 
 
 
 
 
 
 
7- Change the color of the button.
 
 
 
 
 
 
 
8- Now repeat step 6 and 7 for the "Down" frame. Leave the "Hit" frame empty.


9- The animation for the button is done. You can test the button animation by pressing Ctrl + Enter.

10- Now to function the button, which is linking it. Go back to the scene 1.


 
 
 
 
 
 
 
 
11- Select the button and open the actions panel. Write the following actions.

on (press) {
           getURL("http://www.sqhr.comule.com/");
}

Explanation:  "getURL" is the main function used to jump to any location or website. Like if you want to get to any image file location in the images folder of your root directory. Then its actions will be as,
  e.g. getURL("images/name.jpg");


12- All done, now test the movie by pressing Ctrl + Enter.

No comments:

Post a Comment

Please use sensible language.....!