The Event class is used as the base class for the creation of Event objects,
which are passed as parameters to event listeners when an event occurs.

The properties of the Event class carry basic information about an event, such as
the event's type or whether the event's default behavior can be canceled. For many
events, such as the events represented by the Event class constants, this basic information
is sufficient. Other events, however, may require more detailed information. The Adobe®
AIR™ API defines several Event subclasses for common
events that require additional information. Events associated with each of the Event
subclasses are described in the documentation for each class.

The methods of the Event class can be used in event listener functions to affect the
behavior of the event object. Some events have an associated default behavior.
For example, the closing event dispatched by a NativeWindow object
has an associated default behavior that closes the window. Your event listener can cancel this
behavior by calling the preventDefault() method.

Note: Some of the constants in this class are used to define the type
property for events that are dispatched by ActionScript 3.0 display list, used in SWF content. However, some
constants in this class are used to define the type property for events that are not
related to the ActionScript 3.0 display list and are useful in JavaScript code running in the AIR runtime.

currentTarget

property

currentTarget:Object [read-only]

Runtime Versions:

AIR 1.0,

The object that is actively processing the Event object with an event listener. For example, if a user clicks an OK button, the current target could be the node containing that button or one of its ancestors that has registered an event listener for that event.

eventPhase

property

eventPhase:uint [read-only]

Runtime Versions:

AIR 1.0,

The current phase in the event flow. This property can contain the following numeric values:

The capture phase (EventPhase.CAPTURING_PHASE).

The target phase (EventPhase.AT_TARGET).

The bubbling phase (EventPhase.BUBBLING_PHASE).

The event flow is defined for display objects in SWF content, which use
the ActionScript 3.0 display object model. The eventPhase property
is only relavent in ActionScript 3.0 code.

target

property

target:Object [read-only]

Runtime Versions:

AIR 1.0,

The event target. This property contains the target node. For example, if a user clicks an OK button, the target node is the display list node containing that button.

clone

Returns a new Event object that is a copy of the original instance of the Event object.
You do not normally call clone(); the EventDispatcher class calls it automatically
when you redispatch an event—that is, when you call dispatchEvent(event) from a handler
that is handling event.

preventDefault

()

method

public function preventDefault():void

Runtime Versions:

AIR 1.0,

Cancels an event's default behavior if that behavior can be canceled.

Many events have associated behaviors that are carried out by default.
For example, if a user clicks the close box of a window,
the default behavior is that the window closes. Because the closing
event's default behavior can be canceled, you can use the preventDefault()
method to prevent the window from closing.

You can use the Event.cancelable property to check whether you can prevent
the default behavior associated with a particular event. If the value of
Event.cancelable is true, then preventDefault() can
be used to cancel the event; otherwise, preventDefault() has no effect.

ADDED

The Event.ADDED constant defines the value of the type property of
an added event object.

The added event applies to the ActionScript 3.0 display list
and is not relevant to JavaScript code.

This event has the following properties:

Property

Value

bubbles

true

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The DisplayObject instance being added to the display list.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event.

ADDED_TO_STAGE

The Event.ADDED_TO_STAGE constant defines the value of the type
property of an addedToStage event object.

The addedToStage event applies to the ActionScript 3.0 display list
and is not relevant to JavaScript code.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The DisplayObject instance being added to the on-stage display list,
either directly or through the addition of a subtree in which the DisplayObject instance is contained.
If the DisplayObject instance is being directly added, the added event occurs before this event.

CANCEL

The Event.CANCEL constant defines the value of the type property of a cancel event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

A reference to the object on which the operation is canceled.

CHANGE

Constant

public static const CHANGE:String = "change"

Runtime Versions:

AIR 1.0,

The Event.CHANGE constant defines the value of the type property of a change event object.

This event has the following properties:

Property

Value

bubbles

true

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The object that has had its value modified.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event.

CLEAR

Constant

public static const CLEAR:String = "clear"

Runtime Versions:

1.5

The Event.CLEAR constant defines the value of the type property
of a clear event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

Any InteractiveObject instance with a listener registered for the clear event.

Note: TextField objects do not dispatch clear, copy, cut, paste,
or selectAll events. TextField objects always include Cut, Copy, Paste, Clear, and Select All commands in the context menu.
You cannot remove these commands from the context menu for TextField objects. For TextField objects, selecting these commands
(or their keyboard equivalents) does not generate clear, copy, cut, paste,
or selectAll events. However, other classes that extend the InteractiveObject class, including components built
using the Flash Text Engine (FTE), will dispatch these events in response to user actions such as keyboard shortcuts and context menus.

CLOSE

Constant

public static const CLOSE:String = "close"

Runtime Versions:

AIR 1.0,

The Event.CLOSE constant defines the value of the type property of a close event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

CONTEXT3D_CREATE

Constant

public static const CONTEXT3D_CREATE:String = "context3DCreate"

Runtime Versions:

3

The Event.CONTEXT3D_CREATE constant defines the value of the type
property of a context3Dcreate event object.
This event is dispatched by Stage3D objects in response to either a call to
Stage3D.requestContext3D() or in response to an OS-triggered reset of the
rendering context of the Stage3D object. Use the context3D property of the Stage3D
object to access the newly created Context3D instance.

COPY

Constant

public static const COPY:String = "copy"

Runtime Versions:

1.5

Defines the value of the type property of a copy event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

Any InteractiveObject instance with a listener registered for the copy event.

Note: TextField objects do not dispatch clear, copy, cut, paste,
or selectAll events. TextField objects always include Cut, Copy, Paste, Clear, and Select All commands in the context menu.
You cannot remove these commands from the context menu for TextField objects. For TextField objects, selecting these commands
(or their keyboard equivalents) does not generate clear, copy, cut, paste,
or selectAll events. However, other classes that extend the InteractiveObject class, including components built
using the Flash Text Engine (FTE), will dispatch these events in response to user actions such as keyboard shortcuts and context menus.

CUT

Constant

public static const CUT:String = "cut"

Runtime Versions:

1.5

Defines the value of the type property of a cut event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

Any InteractiveObject instance with a listener registered for the cut event.

Note: TextField objects do not dispatch clear, copy, cut, paste,
or selectAll events. TextField objects always include Cut, Copy, Paste, Clear, and Select All commands in the context menu.
You cannot remove these commands from the context menu for TextField objects. For TextField objects, selecting these commands
(or their keyboard equivalents) does not generate clear, copy, cut, paste,
or selectAll events. However, other classes that extend the InteractiveObject class, including components built
using the Flash Text Engine (FTE), will dispatch these events in response to user actions such as keyboard shortcuts and context menus.

DEACTIVATE

Constant

public static const DEACTIVATE:String = "deactivate"

Runtime Versions:

AIR 1.0,

The Event.DEACTIVATE constant defines the value of the type property of a deactivate event object.

Note: This event has neither a "capture phase" nor a "bubble phase",
which means that event listeners must be added directly to any potential targets,
whether the target is on the display list or not.

AIR for TV devices never automatically dispatch this event. You can, however, dispatch it manually.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

Any DisplayObject instance with a listener registered for the deactivate event.

HTML_BOUNDS_CHANGE

The Event.HTML_BOUNDS_CHANGE constant defines the value of the type property of an htmlBoundsChange event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The HTMLLoader object.

target

The HTMLLoader object.

HTML_DOM_INITIALIZE

Constant

public static const HTML_DOM_INITIALIZE:String = "htmlDOMInitialize"

Runtime Versions:

1.0

The Event.HTML_DOM_INITIALIZE constant defines the value of the type property
of an htmlDOMInitialize event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The HTMLLoader object.

target

The HTMLLoader object.

HTML_RENDER

Constant

public static const HTML_RENDER:String = "htmlRender"

Runtime Versions:

1.0

The Event.HTML_RENDER constant defines the value of the type property of an htmlRender event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The HTMLLoader object.

target

The HTMLLoader object.

ID3

Constant

public static const ID3:String = "id3"

Runtime Versions:

AIR 1.0,

The Event.ID3 constant defines the value of the type property of an id3 event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The Sound object loading the MP3 for which ID3 data is now available.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event.

INIT

The Event.INIT constant defines the value of the type property of an init event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The LoaderInfo object associated with the SWF file being loaded.

LOCATION_CHANGE

Constant

public static const LOCATION_CHANGE:String = "locationChange"

Runtime Versions:

1.0

The Event.LOCATION_CHANGE constant defines the value of the type property of a locationChange event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The HTMLLoader object.

target

The HTMLLoader object.

MOUSE_LEAVE

Constant

public static const MOUSE_LEAVE:String = "mouseLeave"

Runtime Versions:

AIR 1.0,

The Event.MOUSE_LEAVE constant defines the value of the type property of a mouseLeave event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The Stage object.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event.

PASTE

The Event.PASTE constant defines the value of the type property of a paste event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

Any InteractiveObject instance with a listener registered for the paste event.

Note: TextField objects do not dispatch clear, copy, cut, paste,
or selectAll events. TextField objects always include Cut, Copy, Paste, Clear, and Select All commands in the context menu.
You cannot remove these commands from the context menu for TextField objects. For TextField objects, selecting these commands
(or their keyboard equivalents) does not generate clear, copy, cut, paste,
or selectAll events. However, other classes that extend the InteractiveObject class, including components built
using the Flash Text Engine (FTE), will dispatch these events in response to user actions such as keyboard shortcuts and context menus.

PREPARING

Constant

public static const PREPARING:String = "preparing"

Runtime Versions:

2.6

The Event.PREPARING constant defines the value of the type property of a preparing event object.

Note: This event does not go through a "capture phase"
and is dispatched directly to the target, whether the target is on the display list or not.

REMOVED

The Event.REMOVED constant defines the value of the type property of
a removed event object.

The removed event applies to the ActionScript 3.0 display list
and is not relevant to JavaScript code.

This event has the following properties:

Property

Value

bubbles

true

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The DisplayObject instance to be removed from the display list.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event.

REMOVED_FROM_STAGE

The Event.REMOVED_FROM_STAGE constant defines the value of the type
property of a removedFromStage event object.

The removedFromStage event applies to the ActionScript 3.0 display list
and is not relevant to JavaScript code.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The DisplayObject instance being removed from the on-stage display list,
either directly or through the removal of a subtree in which the DisplayObject instance is contained.
If the DisplayObject instance is being directly removed, the removed event occurs before this event.

SCROLL

The Event.SCROLL constant defines the value of the type property of a scroll event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The TextField object that has been scrolled.
The target property is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event.

SELECT

Constant

public static const SELECT:String = "select"

Runtime Versions:

AIR 1.0,

The Event.SELECT constant defines the value of the type property of a select event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

SELECT_ALL

The Event.SELECT_ALL constant defines the value of the type property of a selectAll event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

Any InteractiveObject instance with a listener registered for the selectAll event.

Note: TextField objects do not dispatch clear, copy, cut, paste,
or selectAll events. TextField objects always include Cut, Copy, Paste, Clear, and Select All commands in the context menu.
You cannot remove these commands from the context menu for TextField objects. For TextField objects, selecting these commands
(or their keyboard equivalents) does not generate clear, copy, cut, paste,
or selectAll events. However, other classes that extend the InteractiveObject class, including components built
using the Flash Text Engine (FTE), will dispatch these events in response to user actions such as keyboard shortcuts and context menus.

SOUND_COMPLETE

Constant

public static const SOUND_COMPLETE:String = "soundComplete"

Runtime Versions:

AIR 1.0,

The Event.SOUND_COMPLETE constant defines the value of the type property of a soundComplete event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

STANDARD_OUTPUT_CLOSE

The Event.STANDARD_OUTPUT_CLOSE constant defines the value of the type property of a standardOutputClose event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

target

The NativeProcess object.

TAB_CHILDREN_CHANGE

Constant

public static const TAB_CHILDREN_CHANGE:String = "tabChildrenChange"

Runtime Versions:

AIR 1.0,

The Event.TAB_CHILDREN_CHANGE constant defines the value of the type property of a tabChildrenChange event object.

This event has the following properties:

Property

Value

bubbles

true

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The object whose tabChildren flag has changed.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event.

TAB_ENABLED_CHANGE

Constant

public static const TAB_ENABLED_CHANGE:String = "tabEnabledChange"

Runtime Versions:

AIR 1.0,

The Event.TAB_ENABLED_CHANGE constant defines the value of the type
property of a tabEnabledChange event object.

The tabEnabledChange event applies to the ActionScript 3.0 display list
and is not relevant to JavaScript code.

This event has the following properties:

Property

Value

bubbles

true

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The InteractiveObject whose tabEnabled flag has changed.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event.

TAB_INDEX_CHANGE

Constant

public static const TAB_INDEX_CHANGE:String = "tabIndexChange"

Runtime Versions:

AIR 1.0,

The Event.TAB_INDEX_CHANGE constant defines the value of the
type property of a tabIndexChange event object.

The tabIndexChange event applies to the ActionScript 3.0 display list
and is not relevant to JavaScript code.

This event has the following properties:

Property

Value

bubbles

true

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The object whose tabIndex has changed.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event.

TEXT_INTERACTION_MODE_CHANGE

The Event.TEXT_INTERACTION_MODE_CHANGE constant defines the value of the type property of an interaction mode event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The TextField object whose interaction mode property is changed. For example on Android, one can change the interaction mode to SELECTION via context menu.
The target property is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event.

UNLOAD

Constant

public static const UNLOAD:String = "unload"

Runtime Versions:

AIR 1.0,

The Event.UNLOAD constant defines the value of the type property of an unload event object.

This event has the following properties:

Property

Value

bubbles

false

cancelable

false; there is no default behavior to cancel.

currentTarget

The object that is actively processing the Event
object with an event listener.

target

The LoaderInfo object associated with the SWF file being unloaded or replaced.

USER_IDLE

Constant

public static const USER_IDLE:String = "userIdle"

Runtime Versions:

1.0

The Event.USER_IDLE constant defines the value of the type property of a userIdle event object.