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

Behaviors

There have been numerous additions to ActionScript in version 2.0. There have also been additions to the Actions panel (more on ActionScript in Chapter 8). But the biggest difference between Flash MX and Flash MX 2004 in the ActionScript department is the loss of normal mode in the ActionScript editor. Now all ActionScript written in the editor must be done in expert mode; that means you have to do straight typing or use the Actions toolbox on the side to drag blocks of code into the ActionScript editor. However, when a door closes, a window opens, and that window is behaviors.

Behaviors are snippets of code that you attach directly to objects on the stage, such as movie clips or buttons. Behaviors even have their own panel, as you can see in Figure 1.6. To add a behavior to an object, select the object on the stage, click the Add Behavior button in the panel, and choose which type of behavior you want and which specific one you will use. After you've done that, you can further customize the behavior by setting its event (events are covered in Chapter 14, “Events”) such as onPress or onLoad.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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