About 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

Using an event object
When a Flex component dispatches an event, it creates an event object, where the properties
of the event object contain information describing the event. An event listener takes this event
object as an argument and accesses the properties of the object to determine information
about the event.
The base class for all event objects is the
of the Event class, or instances of a subclass of the Event class.
The following table describes the public properties of the
implements these properties using getter methods:
Property
Type
type
String
EventDispatcher A reference to the component instance that dispatches the
target
currentTarget
EventDispatcher A reference to the component instance that is actively
uint
eventPhase
bubbles
Boolean
Boolean
cancelable
flash.events.Event
Description
The name of the event; for example,
constructor sets this property.
event. This property is set by the
you cannot change this to a different object.
processing the Event object. The value of this property is
different from the value of the
event capture and bubbling phase. For more information,
see
Chapter 5, "Using Events,"
The current phase in the event flow. The property might
contain the following values:
EventPhase.CAPTURING_PHASE
EventPhase.AT_TARGET
EventPhase.BUBBLING_PHASE
Whether an event is a bubbling event. If the event can
bubble, the value for this property is
. You can optionally pass this property as a
false
constructor argument to the Event class. By default, most
event classes set this property to
information, see
Chapter 5, "Using Events,"
Developer's Guide.
Whether the event can be canceled. If the event can be
canceled, the value for this value is
. You can optionally pass this property as a
false
constructor argument to the Event class. By default, most
event classes set this property to
information, see
Chapter 5, "Using Events,"
Developer's Guide.
class. All event objects are instances
Event
class. The Event class
. The event
"click"
dispatchEvent()
property during the
target
in Flex 2 Developer's Guide.
: The capture phase
: The target phase
: The bubbling phase
otherwise, it is
true,
. For more
false
in Flex 2
otherwise, it is
true,
. For more
false
in Flex 2

About events

method;
37

Advertisement

Table of Contents
loading

Table of Contents