• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Button Properties

To look at button properties, let's jump into some code.

1.
Open chapter4/buttons1.fla.

2.
Notice there are three blue buttons in this movie. They're in the Button Common Library that comes with Flash. I just happen to like these buttons, which are shown in Figure 4-1.

Figure 4-1. Original button positions


3.
Notice that the bottom two buttons are called “but1” and “but2.” The middle button is called “myButton.” To see a button's name, click on the button and open the Properties panel.

4.
Click in the actions layer and open the Actions panel.

5.
Enter the following code:

but1._x = 50; 
but1._y = 50;
but2._x = but2._y = 300;
myButton._x = 150;
myButton._y = 200;

6.
Test the movie. It should look like Figure 4-2. Notice the buttons have moved from their original position.

Figure 4-2. New button positions



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint