Chapter 4: Creating Custom Events - Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

CHAPTER 4
Creating Custom Events
You can create custom events as part of defining MXML and ActionScript components.
Custom events let you add functionality to your custom components to respond to user
interactions, to trigger actions by your custom component, and to take advantage of data
binding. This topic presents an overview of how to dispatch custom events from your MXML
and ActionScript components, and how to create Event classes by creating a subclass of the
Event class.
The basic concepts of creating custom events are described here, however, subsequent topics
describe this process in more detail for MXML and ActionScript components. For more
information on creating custom events for MXML components, see
Advanced MXML Components," on page
ActionScript components, see
ActionScript," on page
121.
Contents
About events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Dispatching custom events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
About events
Adobe Flex applications are event-driven. Events let an application know when the user
interacts with the interface, and also when important changes happen in the appearance or life
cycle of a component, such as the creation of a component or its resizing. Events can be
generated by user input devices, such as the mouse and keyboard, or by the asynchronous
operations, such as the return of a web service call or the firing of a timer.
The core class of the Flex component architecture, mx.core.UIComponent, defines core
events, such as
updateComplete
fundamental to all components. Subclasses of UIComponent inherit these events.
91. For information on creating them for
Chapter 9, "Creating Simple Visual Components in
,
,
,
resize
move
creationComplete
Chapter 8, "Creating
, and others that are
35
4

Advertisement

Table of Contents
loading

Table of Contents