• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part IIA: Basic Workshops > Working with Odd-Shaped Clickable Areas

Workshop Chapter 6. Working with Odd-Shaped Clickable Areas

Flash buttons are the easiest way to trap mouse clicks. Buttons are simple and powerful. It’s easy to include Over-and Down-states and even to define an odd shape that’s clickable in the Hot-state. Placing a script on a button opens up a variety of mouse events to which you can respond.

For all their greatness, buttons are fixed in their feature set: As soon as you want more, they become limited. In addition, the fact that Movie Clips can now trap mouse events (once reserved for buttons) means that you can avoid buttons completely. Movie Clips give you access to clip events such as mouseDown, mouseUp, and mouseMove. The only catch is that clips respond to all mouse events regardless of where the event occurs; for example, the mouseDown event will be received regardless of where you click. However, if we use clips in conjunction with the Movie Clip object method hitTest(), we can determine whether the user has clicked on a particular clip. You’ll see that the alternative (to use a mouse event, such as onPress, on a clip) is not always ideal because it makes the clip start acting like a button—including making the hand cursor appear.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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