Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

  • Print
  • + Share This
This chapter is from the book

Button-tracking Options

You can define a button instance in the Properties inspector in one of two ways: Track as Button or Track as Menu Item circle-a.jpg. These two tracking options determine whether button instances can receive a button event even after the event has started on a different button instance. The Track as Menu Item option allows this to happen; the Track as Button option doesn’t. The default option, Track as Button, is the typical behavior for buttons; it causes one button event to affect one button instance. More complex cases, such as pull-down menus, require multiple button instances working together.

Imagine that you click and hold down the menu button to see the pop-up choices, drag your pointer to your selection, and then release the mouse button. You need Flash to recognize the MouseEvent.MOUSE_UP event in the expanded menu even though the MouseEvent.MOUSE_DOWN event occurred in the collapsed menu for a different button instance (in fact, in a different frame altogether). Choosing Track as Menu Item allows these buttons to receive these events and gives you more flexibility to work with combinations of buttons and events.

To set Track as Menu Item for a pull-down menu

  1. Continue with the pull-down menu, as described in the preceding task.
  2. Go to symbol-editing mode for the movie clip.
  3. Select the keyframe on frame 1 containing the event handler for the button instance, and change the mouse event to MouseEvent.MOUSE_DOWN circle-b.jpg.
  4. Select the keyframe containing the ActionScript for the expanded section. Replace all the MouseEvent.CLICK events with MouseEvent.MOUSE_UP circle-c.jpg.
  5. Select each button instance in the expanded keyframe.
  6. In the Properties inspector, choose Track as Menu Item circle-d.jpg.

    The button instances in the expanded menu will now trigger a MouseEvent.MOUSE_UP event even if the MouseEvent.MOUSE_DOWN event occurs on a different instance.

  7. Return to the main Timeline, and test your movie.

    You now click and hold down the mouse button to keep the menu open, and then release the mouse button when you’ve made your selection.

  • + Share This
  • 🔖 Save To Your Account