O'Reilly logo

Flash 8: The Missing Manual by E. A. Vander Veer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding an Action

For an action to work, you must attach it to something in your animation. You add an action to either an object (like a component or symbol) or a frame, depending on when you want Flash to perform the action.

In this section, you see an example of adding an action to an instance of a button symbol (Section 7.1.4), but the technique's the same no matter where you're putting the action. Just remember to select the object on the Stage—or a frame in the Timeline—and then create the action.

Note

Chapter 10 describes the differences between frame- and object-based actions and when you want to choose one over the other.

To add an action:

  1. Open the document hotspot_drag_begin.fla.

    You can download this example file from the "Missing CD" page at www.missingmanuals.com/cds. It has a drawing all ready for you to practice on. (For a working copy, download hotspot_drag.fla.)

  2. Choose Window → Properties → Properties to display the Property Inspector.

  3. On the Stage, click Smiley's left eye (see Figure 9-4).

    Flash highlights the instance of the leftEye button symbol and displays instance-related properties in the Properties tab of the Property Inspector.

  4. In the Property Inspector, click the "Instance name" field type in myLeftEye-Instance and then hit Return.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required