Using ActionScript 3.0 Components |
|
|
|
| Working with Components > Handling events | |||
Every component broadcasts events when a user interacts with it. When a user clicks a Button, for example, it dispatches a MouseEvent.CLICK event and when a user selects an item in a List, the List dispatches an Event.CHANGE event. An event can also occur when something significant happens to a component such as when content finishes loading for a UILoader instance, generating an Event.COMPLETE event. To handle an event, you write ActionScript code that executes when the event occurs.
A component's events include the events of any class from which the component inherits. This means that all ActionScript 3.0 User Interface components inherit events from the UIComponent class because it is the base class for the ActionScript 3.0 User Interface components. To see the list of events a component broadcasts, see the Events section of the component's class entry in the ActionScript 3.0 Language and Components Reference.
For a complete explanation of event handling in ActionScript 3.0, see Programming ActionScript 3.0.
|
|
|
|