Flash CS3 Documentation |
|||
| Programming ActionScript 3.0 > Capturing user input > Basics of user input | |||
User interaction, whether by keyboard, mouse, camera, or a combination of these devices, is the foundation of interactivity. In ActionScript 3.0, identifying and responding to user interaction primarily involves listening to events.
The InteractiveObject class, a subclass of the DisplayObject class, provides the common structure of events and functionality necessary for handling user interaction. You do not directly create an instance of the InteractiveObject class. Instead, display objects such as SimpleButton, Sprite, TextField, and various Flash and Flex components inherit their user interaction model from this class and therefore share a common structure. This means that the techniques you learn and the code you write to handle user interaction in an object derived from InteractiveObject are applicable to all the others.
The following typical user interaction tasks are described in this chapter:
It's important to familiarize yourself with the following key user interaction terms before proceeding:
As you're working through the chapter, you may want to test some of the sample code listings for yourself. Because this chapter is about working with user input in ActionScript, essentially all the code listings in this chapter involve manipulating some type of display object--usually a text field or any InteractiveObject subclass. For the purposes of the examples, the display object either can be one that has been created and placed on the Stage in Adobe Flash CS3 Professional, or can be one that's created using ActionScript. Testing a sample involves viewing the result in Flash Player and interacting with the sample to see the effects of the code.
myDisplayObject, name your Stage object myDisplayObject as well.On the screen, the display object is manipulated as specified in the code.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00000310.html