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

Adding Behaviors

Behaviors are timesavers because they give you sections of ActionScript code for common Flash tasks. In addition, behaviors are a great way to introduce yourself to the wonderful world of ActionScripting without having to write all the code. For example, if you want to add a Play ActionScript to a button, you can do it using the Add button in the Behaviors panel, or you can write out the code on your own; see the example code below. Using Behaviors, as opposed to writing the code by hand, is not better, they're simply faster. The more time you save doing common Action-Scripting tasks using Behaviors, the more time you will have for the creative process.

Using the Behaviors Panel

You use the Behaviors panel to apply the behavior to a triggering object, such as a button. You specify the event that triggers the behavior, such as releasing the mouse, select a target object, such as the movie clip instance, and then select settings for behavior parameters, such as a frame number or label, or a relative or absolute path. Flash comes with built-in behaviors, such as Load Graphic, Duplicate Movieclip, and GotoAndPlay At Frame Or Label. To add and configure a behavior, select a trigger object, and then step through the following general instructions (steps may vary depending on the behavior):


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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