The one consistent interface between most people and their computers is, as you know, the keyboard and mouse. Because you can use Flash Player for so many different kinds of applications, it has a flexible model for capturing the user's mouse and keyboard input. You can do anything from simply capturing clicks on buttons to accepting complex mouse gestures. Flash Player's input handling is closely tied to its event model and the display list. All mouse and keyboard input are available to ActionScript 3.0 code as events of type
KeyboardEvent. In this chapter, you'll learn how mouse and keyboard events are handled in general, investigate the various kinds of events Flash Player exposes, and see a variety of real-world input handling code. I'll also cover the focus model in Flash Player and creating custom context menus.
InteractiveObject can dispatch events when interacted with using the keyboard and mouse. This, of course, applies to the subclasses of
InteractiveObject, which includes all
Loaders, and the
Stage; but not
You'll learn how to listen and respond to these events, determine which events are available, ...