About Events; Component Startup Life Cycle - Adobe FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manual

Migrating applications to flex 2
Table of Contents

Advertisement

About events

The following list is a general overview of the changes to the Event model. Review all event
handling in your Flex application by using these guidelines.
All event objects are either of type Event or a subclass of Event. You should explicitly
declare or cast them to their appropriate type.
Use static constants such as
type, such as "
click
Do not use object event listeners. Instead use function listeners. For more information, see
"Using function listeners" on page
Scoping in event listeners is improved. You no longer need to pass a Delegate to maintain
scope.
Use the
currentTarget
object that is listening for the event. The
dispatched the event.
Subclasses of Event, such as MouseEvent, have all the properties of the Event object and
properties that are specific to that type of event. Choosing the most specific type possible
provides the following benefits:
Faster run-time performance
Compile-time type-checking
Access to event-specific properties
Smaller SWF file size

Component startup life cycle

The ordering of events during a component's initialization has changed. The
event is now named
preinitialize
The
event now occurs after children are added to the component. As a result,
initialize
instead of calling an event handler for the
event handler to perform most initialization tasks. You typically call
initialize
when you have to wait until the LayoutManager has processed the
creationComplete
children so that the
x
The
childrenCreated
instead.
A new event,
applicationComplete
when an application starts up.
112
Events
MouseEvent.CLICK
". For more information, see
115.
property instead of the
.
,
,
, and
y
width
height
event has been removed. You should use the
, has been added. This event is the last one dispatched
instead of string literals for the event
"Using static constants" on page
property when you access the
target
property refers to the object that
target
event, you can use the
creationComplete
properties are known.
114.
initialize
event
initialize

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex 2

Table of Contents