flash.events

# Event - AS3

Package | flash.events
Class | public class Event
Inheritance | Event Object
Subclasses | AccelerometerEvent, ActionSelectedEvent, ActivityEvent, AdvancedDataGridEvent, AdvancedDataGridHeaderShiftEvent, AdvancedDataGridItemSelectEvent, AIREvent, AlternativeAudioEvent, AnnotationParseEvent, AssetActionCompleteEvent, AssetActionCompleteEvent, AssetActionEvent, AssetActionsChangeEvent, AssetValidationEvent, AttachmentEvent, AudioEvent, AuthenticationEvent, AutomationAirEvent, AutomationEvent, AutomationFlexNativeMenuEvent, AutomationRecordEvent, AutomationReplayEvent, AVDictionaryDataEvent, AVHTTPStatusEvent, AVPauseAtPeriodEndEvent, BaseEvent, BrowserChangeEvent, BrowserInvokeEvent, BufferEvent, BundleEvent, CalendarLayoutChangeEvent, CaptionChangeEvent, CaptionTargetEvent, ChannelEvent, ChartSelectionChangeEvent, ChildExistenceChangedEvent, CloseEvent, CollectionEvent, ColorPickerEvent, ColorPickerEvent, ComponentEvent, CompositionCompleteEvent, ComputationErrorEvent, ConflictEvent, ContainerChangeEvent, ContextMenuEvent, CubeEvent, CuePointEvent, DamageEvent, DataChangeEvent, DataConflictEvent, DataElementsPanelToolBarEvent, DatagramSocketDataEvent, DataGridEvent, DateChooserEvent, DCTEvent, DDInstanceValueChangeEvent, DisplayObjectEvent, DividerEvent, DNSResolverEvent, DocumentPodEvent, DRMAuthenticateEvent, DRMAuthenticationCompleteEvent, DRMDeviceGroupEvent, DRMEvent, DRMLicenseRequestEvent, DRMMetadataEvent, DRMReturnVoucherCompleteEvent, DRMStatusEvent, DropdownEvent, DropDownEvent, DVREvent, DynamicEvent, DynamicStreamEvent, EffectEvent, ElementExistenceEvent, ErrorEvent, ExpressionBuilderEvent, ExpressionEvent, ExpressionInsertEvent, ExpressionRegistrationFailureEvent, ExpressionRegistrationSuccessEvent, ExpressionsPanelToolBarEvent, ExpressionValueChangeEvent, FileEvent, FileEvent, FileListEvent, FlexEvent, FlexNativeMenuEvent, FlowElementMouseEvent, FlowOperationEvent, FocusEvent, FunctionFamilyProviderEvent, FunctionsPanelToolBarEvent, GAEvent, GameInputEvent, GanttActionEvent, GanttEvent, GeolocationEvent, GestureEvent, GridCaretEvent, GridItemEditorEvent, GridSelectionEvent, GridSortEvent, HTMLUncaughtScriptExceptionEvent, HTTPStatusEvent, IKEvent, IndexChangedEvent, IndexChangeEvent, InterManagerRequest, InvokeEvent, ItemClickEvent, KeyboardEvent, LabelEditorEvent, LayoutEvent, LayoutEvent, ListEvent, ListEvent, ListItemSelectEvent, LiveCycleEvent, LiveCycleFaultEvent, LoaderEvent, LoaderInvalidationEvent, LoadEvent, LocationChangeEvent, LogEvent, MarshalledAutomationEvent, MediaElementEvent, MediaErrorEvent, MediaEvent, MediaFactoryEvent, MediaPlayerCapabilityChangeEvent, MediaPlayerStateChangeEvent, MenuShowEvent, Message, MessageEvent, MessageFaultEvent, MetadataEvent, MetadataEvent, MetadataEvent, MotionEvent, MouseEvent, MoveEvent, NativeProcessExitEvent, NativeWindowBoundsEvent, NativeWindowDisplayStateEvent, NetConnectionFactoryEvent, NetDataEvent, NetMonitorEvent, NetStatusEvent, NumericStepperEvent, OptionMenuEvent, OutputProgressEvent, PackageDefinitionLoadFailedEvent, PackageDefinitionReadyEvent, PackageObjectReadyEvent, PermissionEvent, PlayEvent, PluginNotInstalledEvent, PopUpEvent, PreviewEvent, PRMErrorEvent, ProcessComponentEvent, ProgressEvent, ProjectEvent, PropertyChangeEvent, PropertyLoadEvent, QoSInfoEvent, RCAErrorEvent, ReferenceChangedEvent, RelationEvent, RemoteNotificationEvent, RendererExistenceEvent, Request, RequestAwareEvent, ResizeEvent, RSLEvent, SampleDataEvent, SandboxMouseEvent, ScaleChangedEvent, SchedulesStateEvent, ScrollEvent, ScrollEvent, SearchEvent, SearchEvent, SeekEvent, SelectionEvent, SerialElementEvent, ServerSocketConnectEvent, ServiceEvent, SessionFaultEvent, SessionResultEvent, ShaderEvent, SliderEvent, SliderEvent, SoftKeyboardEvent, SoundEvent, SparkDataGridItemSelectEvent, SparkListItemSelectEvent, SparkValueChangeAutomationEvent, SQLEvent, SQLUpdateEvent, StageEvent, StageOrientationEvent, StageParticipantEvent, StageVideoAvailabilityEvent, StageVideoEvent, StartpointEvent, StateChangeEvent, StatusChangeEvent, StatusEvent, StorageVolumeChangeEvent, SwfAppButtonEvent, SwfAppEvent, SWFBridgeEvent, SWFBridgeRequest, SwfDataEvent, SyncEvent, TabLayoutEvent, TaskCompletedEvent, TaskManagerEvent, TaskManagerFaultEvent, TaskPropertyChangedEvent, TeamPodEvent, TemplateEvent, TextEvent, TextLayoutEvent, TextOperationEvent, TextSelectionEvent, ThrottleEvent, TimeEvent, TimerEvent, TitleWindowBoundsEvent, ToolTipEvent, TouchEvent, TouchInteractionEvent, TrackBaseEvent, TreeEvent, TweenEvent, TweenEvent, UpdateCompleteEvent, UpdateEvent, UploadEvent, UserEvent, UserSelectedEvent, ValidationResultEvent, VariableChangeEvent, VersionEvent, VideoEvent, VideoEvent, VideoEvent, VideoTextureEvent, ViewNavigatorEvent, WorkItemEvent, XFADataLoadFailedEvent, XFADataReadyEvent, XFADataSavedEvent, XFADataSaveFailedEvent, XMLDataReadyEvent, XMLLoadEvent

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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. Events associated with a mouse click, for example, need to include additional information about the location of the click event and whether any keys were pressed during the click event. You can pass such additional information to event listeners by extending the Event class, which is what the MouseEvent class does. ActionScript 3.0 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 `doubleClick` event has an associated default behavior that highlights the word under the mouse pointer at the time of the event. Your event listener can cancel this behavior by calling the `preventDefault()` method. You can also make the current event listener the last one to process an event by calling the `stopPropagation()` or `stopImmediatePropagation()` method.

Other sources of information include:

- A useful description about the timing of events, code execution, and rendering at runtime in Ted Patrick's blog entry: Flash Player Mental Model - The Elastic Racetrack.
- A blog entry by Johannes Tacskovics about the timing of frame events, such as ENTER_FRAME, EXIT_FRAME: The MovieClip Lifecycle.
- An article by Trevor McCauley about the order of ActionScript operations: Order of Operations in ActionScript.
- A blog entry by Matt Przybylski on creating custom events: AS3: Custom Events.

View the examples

More examples

Using events
Manually dispatching events
Using event subclasses
Event handling example: Alarm Clock

Learn more

About Flex events
About the Event class
Event propagation
Event priorities
About keyboard events
Basics of handling events
How ActionScript 3.0 event handling differs from earlier versions
The event flow
Event objects
Handling events for display objects

Related API Elements

flash.events.EventDispatcher

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | bubbles : Boolean [read-only] Indicates whether an event is a bubbling event. | Event
|  | cancelable : Boolean [read-only] Indicates whether the behavior associated with the event can be prevented. | Event
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | currentTarget : Object [read-only] The object that is actively processing the Event object with an event listener. | Event
|  | eventPhase : uint [read-only] The current phase in the event flow. | Event
|  | target : Object [read-only] The event target. | Event
|  | type : String [read-only] The type of event. | Event

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | Event(type:String, bubbles:Boolean = false, cancelable:Boolean = false) Creates an Event object to pass as a parameter to event listeners. | Event
|  | clone():Event Duplicates an instance of an Event subclass. | Event
|  | formatToString(className:String, ... arguments):String A utility function for implementing the toString() method in custom ActionScript 3.0 Event classes. | Event
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isDefaultPrevented():Boolean Checks whether the preventDefault() method has been called on the event. | Event
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | preventDefault():void Cancels an event's default behavior if that behavior can be canceled. | Event
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | stopImmediatePropagation():void Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow. | Event
|  | stopPropagation():void Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. | Event
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns a string containing all the properties of the Event object. | Event
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Public Constants

| Constant | Defined By
--- | --- | ---
|  | ACTIVATE : String = "activate" [static] The ACTIVATE constant defines the value of the type property of an activate event object. | Event
|  | ADDED : String = "added" [static] The Event.ADDED constant defines the value of the type property of an added event object. | Event
|  | ADDED_TO_STAGE : String = "addedToStage" [static] The Event.ADDED_TO_STAGE constant defines the value of the type property of an addedToStage event object. | Event
|  | BROWSER_ZOOM_CHANGE : String = "browserZoomChange" [static] The Event.BROWSER_ZOOM_CHANGE constant defines the value of the type property of an browserZoomChange event object. | Event
|  | CANCEL : String = "cancel" [static] The Event.CANCEL constant defines the value of the type property of a cancel event object. | Event
|  | CHANGE : String = "change" [static] The Event.CHANGE constant defines the value of the type property of a change event object. | Event
|  | CHANNEL_MESSAGE : String = "channelMessage" [static] The Event.CHANNEL_MESSAGE constant defines the value of the type property of a channelMessage event object. | Event
|  | CHANNEL_STATE : String = "channelState" [static] The Event.CHANNEL_STATE constant defines the value of the type property of a channelState event object. | Event
|  | CLEAR : String = "clear" [static] The Event.CLEAR constant defines the value of the type property of a clear event object. | Event
|  | CLOSE : String = "close" [static] The Event.CLOSE constant defines the value of the type property of a close event object. | Event
|  | CLOSING : String = "closing" [static] The Event.CLOSING constant defines the value of the type property of a closing event object. | Event
|  | COMPLETE : String = "complete" [static] The Event.COMPLETE constant defines the value of the type property of a complete event object. | Event
|  | CONNECT : String = "connect" [static] The Event.CONNECT constant defines the value of the type property of a connect event object. | Event
|  | CONTEXT3D_CREATE : String = "context3DCreate" [static] The Event.CONTEXT3D_CREATE constant defines the value of the type property of a context3Dcreate event object. | Event
|  | COPY : String = "copy" [static] Defines the value of the type property of a copy event object. | Event
|  | CUT : String = "cut" [static] Defines the value of the type property of a cut event object. | Event
|  | DEACTIVATE : String = "deactivate" [static] The Event.DEACTIVATE constant defines the value of the type property of a deactivate event object. | Event
|  | DISPLAYING : String = "displaying" [static] The Event.DISPLAYING constant defines the value of the type property of a displaying event object. | Event
|  | ENTER_FRAME : String = "enterFrame" [static] The Event.ENTER_FRAME constant defines the value of the type property of an enterFrame event object. | Event
|  | EXIT_FRAME : String = "exitFrame" [static] The Event.EXIT_FRAME constant defines the value of the type property of an exitFrame event object. | Event
|  | EXITING : String = "exiting" [static] The Event.EXITING constant defines the value of the type property of an exiting event object. | Event
|  | FRAME_CONSTRUCTED : String = "frameConstructed" [static] The Event.FRAME_CONSTRUCTED constant defines the value of the type property of an frameConstructed event object. | Event
|  | FRAME_LABEL : String = "frameLabel" [static] The Event.FRAME_LABEL constant defines the value of the type property of an frameLabel event object. | Event
|  | FULLSCREEN : String = "fullScreen" [static] The Event.FULL_SCREEN constant defines the value of the type property of a fullScreen event object. | Event
|  | HTML_BOUNDS_CHANGE : String = "htmlBoundsChange" [static] The Event.HTML_BOUNDS_CHANGE constant defines the value of the type property of an htmlBoundsChange event object. | Event
|  | HTML_DOM_INITIALIZE : String = "htmlDOMInitialize" [static] The Event.HTML_DOM_INITIALIZE constant defines the value of the type property of an htmlDOMInitialize event object. | Event
|  | HTML_RENDER : String = "htmlRender" [static] The Event.HTML_RENDER constant defines the value of the type property of an htmlRender event object. | Event
|  | ID3 : String = "id3" [static] The Event.ID3 constant defines the value of the type property of an id3 event object. | Event
|  | INIT : String = "init" [static] The Event.INIT constant defines the value of the type property of an init event object. | Event
|  | LOCATION_CHANGE : String = "locationChange" [static] The Event.LOCATION_CHANGE constant defines the value of the type property of a locationChange event object. | Event
|  | MOUSE_LEAVE : String = "mouseLeave" [static] The Event.MOUSE_LEAVE constant defines the value of the type property of a mouseLeave event object. | Event
|  | NETWORK_CHANGE : String = "networkChange" [static] The Event.NETWORK_CHANGE constant defines the value of the type property of a networkChange event object. | Event
|  | OPEN : String = "open" [static] The Event.OPEN constant defines the value of the type property of an open event object. | Event
|  | PASTE : String = "paste" [static] The Event.PASTE constant defines the value of the type property of a paste event object. | Event
|  | PREPARING : String = "preparing" [static] The Event.PREPARING constant defines the value of the type property of a preparing event object. | Event
|  | REMOVED : String = "removed" [static] The Event.REMOVED constant defines the value of the type property of a removed event object. | Event
|  | REMOVED_FROM_STAGE : String = "removedFromStage" [static] The Event.REMOVED_FROM_STAGE constant defines the value of the type property of a removedFromStage event object. | Event
|  | RENDER : String = "render" [static] The Event.RENDER constant defines the value of the type property of a render event object. | Event
|  | RESIZE : String = "resize" [static] The Event.RESIZE constant defines the value of the type property of a resize event object. | Event
|  | SCROLL : String = "scroll" [static] The Event.SCROLL constant defines the value of the type property of a scroll event object. | Event
|  | SELECT : String = "select" [static] The Event.SELECT constant defines the value of the type property of a select event object. | Event
|  | SELECT_ALL : String = "selectAll" [static] The Event.SELECT_ALL constant defines the value of the type property of a selectAll event object. | Event
|  | SOUND_COMPLETE : String = "soundComplete" [static] The Event.SOUND_COMPLETE constant defines the value of the type property of a soundComplete event object. | Event
|  | STANDARD_ERROR_CLOSE : String = "standardErrorClose" [static] The Event.STANDARD_ERROR_CLOSE constant defines the value of the type property of a standardErrorClose event object. | Event
|  | STANDARD_INPUT_CLOSE : String = "standardInputClose" [static] The Event.STANDARD_INPUT_CLOSE constant defines the value of the type property of a standardInputClose event object. | Event
|  | STANDARD_OUTPUT_CLOSE : String = "standardOutputClose" [static] The Event.STANDARD_OUTPUT_CLOSE constant defines the value of the type property of a standardOutputClose event object. | Event
|  | SUSPEND : String = "suspend" [static] The Event.SUSPEND constant defines the value of the type property of an suspend event object. | Event
|  | TAB_CHILDREN_CHANGE : String = "tabChildrenChange" [static] The Event.TAB_CHILDREN_CHANGE constant defines the value of the type property of a tabChildrenChange event object. | Event
|  | TAB_ENABLED_CHANGE : String = "tabEnabledChange" [static] The Event.TAB_ENABLED_CHANGE constant defines the value of the type property of a tabEnabledChange event object. | Event
|  | TAB_INDEX_CHANGE : String = "tabIndexChange" [static] The Event.TAB_INDEX_CHANGE constant defines the value of the type property of a tabIndexChange event object. | Event
|  | TEXT_INTERACTION_MODE_CHANGE : String = "textInteractionModeChange" [static] The Event.TEXT_INTERACTION_MODE_CHANGE constant defines the value of the type property of a interaction mode event object. | Event
|  | TEXTURE_READY : String = "textureReady" [static] The Event.TEXTURE_READY constant defines the value of the type property of a textureReady event object. | Event
|  | UNLOAD : String = "unload" [static] The Event.UNLOAD constant defines the value of the type property of an unload event object. | Event
|  | USER_IDLE : String = "userIdle" [static] The Event.USER_IDLE constant defines the value of the type property of a userIdle event object. | Event
|  | USER_PRESENT : String = "userPresent" [static] The Event.USER_PRESENT constant defines the value of the type property of a userPresent event object. | Event
|  | VIDEO_FRAME : String = "videoFrame" [static] The Event.VIDEO_FRAME constant defines the value of the type property of a videoFrame event object. | Event
|  | WORKER_STATE : String = "workerState" [static] The Event.WORKER_STATE constant defines the value of the type property of a workerState event object. | Event

Property Detail

### bubbles

property

`bubbles:Boolean` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

Indicates whether an event is a bubbling event. If the event can bubble, this value is `true`; otherwise it is `false`.

When an event occurs, it moves through the three phases of the event flow: the capture phase, which flows from the top of the display list hierarchy to the node just before the target node; the target phase, which comprises the target node; and the bubbling phase, which flows from the node subsequent to the target node back up the display list hierarchy.

Some events, such as the `activate` and `unload` events, do not have a bubbling phase. The `bubbles` property has a value of `false` for events that do not have a bubbling phase.

Implementation
`public function get bubbles():Boolean`

### cancelable

property

`cancelable:Boolean` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

Indicates whether the behavior associated with the event can be prevented. If the behavior can be canceled, this value is `true`; otherwise it is `false`.

Implementation
`public function get cancelable():Boolean`

Related API Elements

Event.preventDefault()

### currentTarget

property

`currentTarget:Object` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.

Implementation
`public function get currentTarget():Object`

Learn more

Event objects

### eventPhase

property

`eventPhase:uint` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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`).

Implementation
`public function get eventPhase():uint`

### target

property

`target:Object` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.

Implementation
`public function get target():Object`

Learn more

Event objects

### type

property

`type:String` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The type of event. The type is case-sensitive.

Implementation
`public function get type():String`

Learn more

Event objects
Constructor Detail

### Event

()
Constructor

`public function Event(type:String, bubbles:Boolean = false, cancelable:Boolean = false)`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

Creates an Event object to pass as a parameter to event listeners.

Parameters

| `type:String` — The type of the event, accessible as `Event.type`.
| `bubbles:Boolean` (default = `false`)`` — Determines whether the Event object participates in the bubbling stage of the event flow. The default value is `false`.
| `cancelable:Boolean` (default = `false`)`` — Determines whether the Event object can be canceled. The default values is `false`.

Method Detail

### clone

()
method

`public function clone():Event`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

Duplicates an instance of an Event subclass.

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`.

The new Event object includes all the properties of the original.

When creating your own custom Event class, you must override the inherited `Event.clone()` method in order for it to duplicate the properties of your custom class. If you do not set all the properties that you add in your event subclass, those properties will not have the correct values when listeners handle the redispatched event.

In this example, `PingEvent` is a subclass of `Event` and therefore implements its own version of `clone()`.

Copy

         class PingEvent extends Event {
             var URL:String;

         public override function clone():Event {
                  return new PingEvent(type, bubbles, cancelable, URL);
            }
         }

Returns

| `Event` — A new Event object that is identical to the original.

### formatToString

()
method

`public function formatToString(className:String, ... arguments):String`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

A utility function for implementing the `toString()` method in custom ActionScript 3.0 Event classes. Overriding the `toString()` method is recommended, but not required.

    	 class PingEvent extends Event {
    	  var URL:String;

    	 public override function toString():String {
    	  return formatToString("PingEvent", "type", "bubbles", "cancelable", "eventPhase", "URL");
    	    }
    	 }

Parameters

| `className:String` — The name of your custom Event class. In the previous example, the `className` parameter is `PingEvent`.
| `... arguments` — The properties of the Event class and the properties that you add in your custom Event class. In the previous example, the `...arguments` parameter includes `type`, `bubbles`, `cancelable`, `eventPhase`, and `URL`.

Returns

| `String` — The name of your custom Event class and the String value of your `...arguments` parameter.

### isDefaultPrevented

()
method

`public function isDefaultPrevented():Boolean`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

Checks whether the `preventDefault()` method has been called on the event. If the `preventDefault()` method has been called, returns `true`; otherwise, returns `false`.

Returns

| `Boolean` — If `preventDefault()` has been called, returns `true`; otherwise, returns `false`.

Related API Elements

flash.events.Event.preventDefault()

### preventDefault

()
method

`public function preventDefault():void`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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 types a character into a text field, the default behavior is that the character is displayed in the text field. Because the `TextEvent.TEXT_INPUT` event's default behavior can be canceled, you can use the `preventDefault()` method to prevent the character from appearing.

An example of a behavior that is not cancelable is the default behavior associated with the `Event.REMOVED` event, which is generated whenever Flash Player is about to remove a display object from the display list. The default behavior (removing the element) cannot be canceled, so the `preventDefault()` method has no effect on this default behavior.

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.

Related API Elements

flash.events.Event.isDefaultPrevented()
Event.cancelable

### stopImmediatePropagation

()
method

`public function stopImmediatePropagation():void`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow. This method takes effect immediately, and it affects event listeners in the current node. In contrast, the `stopPropagation()` method doesn't take effect until all the event listeners in the current node finish processing.

Note: This method does not cancel the behavior associated with this event; see `preventDefault()` for that functionality.

Related API Elements

flash.events.Event.stopPropagation()
flash.events.Event.preventDefault()

### stopPropagation

()
method

`public function stopPropagation():void`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. This method does not affect any event listeners in the current node (`currentTarget`). In contrast, the `stopImmediatePropagation()` method prevents processing of event listeners in both the current node and subsequent nodes. Additional calls to this method have no effect. This method can be called in any phase of the event flow.

Note: This method does not cancel the behavior associated with this event; see `preventDefault()` for that functionality.

Related API Elements

flash.events.Event.stopImmediatePropagation()
flash.events.Event.preventDefault()

### toString

()
method

`public function toString():String`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

Returns a string containing all the properties of the Event object. The string is in the following format:

`[Event type=value bubbles=value cancelable=value]`

Returns

| `String` — A string containing all the properties of the Event object.

Constant Detail

### ACTIVATE

Constant

`public static const ACTIVATE:String = "activate"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `ACTIVATE` constant defines the value of the `type` property of an `activate` 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 `activate` event.

Related API Elements

flash.events.EventDispatcher.activate
DEACTIVATE

### ADDED

Constant

`public static const ADDED:String = "added"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.ADDED` constant defines the value of the `type` property of an `added` 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 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.

Related API Elements

flash.display.DisplayObject.added
ADDED_TO_STAGE
REMOVED
REMOVED_FROM_STAGE

### ADDED_TO_STAGE

Constant

`public static const ADDED_TO_STAGE:String = "addedToStage"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0, Flash Lite 4

The `Event.ADDED_TO_STAGE` constant defines the value of the `type` property of an `addedToStage` 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 DisplayObject instance being added to the on stage display list, either directly or through the addition of a sub tree in which the DisplayObject instance is contained. If the DisplayObject instance is being directly added, the `added` event occurs before this event.

Related API Elements

flash.display.DisplayObject.addedToStage
ADDED
REMOVED
REMOVED_FROM_STAGE

### BROWSER_ZOOM_CHANGE

Constant

`public static const BROWSER_ZOOM_CHANGE:String = "browserZoomChange"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 15, AIR 15

The `Event.BROWSER_ZOOM_CHANGE` constant defines the value of the `type` property of an `browserZoomChange` 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 instance.

Related API Elements

flash.display.Stage.browserZoomChange

### CANCEL

Constant

`public static const CANCEL:String = "cancel"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.

Related API Elements

flash.net.FileReference.cancel

### CHANGE

Constant

`public static const CHANGE:String = "change"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.

Related API Elements

flash.text.TextField.change
flash.events.TextEvent.TEXT_INPUT

### CHANNEL_MESSAGE

Constant

`public static const CHANNEL_MESSAGE:String = "channelMessage"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 11.4, AIR 3.4

The `Event.CHANNEL_MESSAGE` constant defines the value of the `type` property of a `channelMessage` 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 object that dispatched this event.

Related API Elements

flash.system.MessageChannel.channelMessage

### CHANNEL_STATE

Constant

`public static const CHANNEL_STATE:String = "channelState"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 11.4, AIR 3.4

The `Event.CHANNEL_STATE` constant defines the value of the `type` property of a `channelState` 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 object that dispatched this event.

Related API Elements

flash.system.Worker.channelState

### CLEAR

Constant

`public static const CLEAR:String = "clear"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5, Flash Lite 4

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.

Related API Elements

flash.display.InteractiveObject.clear

### CLOSE

Constant

`public static const CLOSE:String = "close"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.
`target` | The object whose connection has been closed.

Related API Elements

flash.net.Socket.close
flash.net.XMLSocket.close
flash.display.NativeWindow.close

### CLOSING

Constant

`public static const CLOSING:String = "closing"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Lite 4

The `Event.CLOSING` constant defines the value of the `type` property of a `closing` event object.

This event has the following properties:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `true`; canceling this event object stops the close operation.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`target` | The object whose connection is to be closed.

Related API Elements

flash.display.NativeWindow.closing

### COMPLETE

Constant

`public static const COMPLETE:String = "complete"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.COMPLETE` constant defines the value of the `type` property of a `complete` 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 network object that has completed loading.

Learn more

Loading external data

Related API Elements

flash.display.LoaderInfo.complete
flash.html.HTMLLoader.complete
flash.media.Sound.complete
flash.net.FileReference.complete
flash.net.URLLoader.complete
flash.net.URLStream.complete

### CONNECT

Constant

`public static const CONNECT:String = "connect"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.CONNECT` constant defines the value of the `type` property of a `connect` 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 Socket or XMLSocket object that has established a network connection.

Related API Elements

flash.net.Socket.connect
flash.net.XMLSocket.connect

### CONTEXT3D_CREATE

Constant

`public static const CONTEXT3D_CREATE:String = "context3DCreate"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 11, AIR 3

The `Event.CONTEXT3D_CREATE` constant defines the value of the `type` property of a `context3Dcreate` event object. This event is raised only by Stage3D objects in response to either a call to Stage3D.requestContext3D or in response to an OS triggered reset of the Context3D bound to the Stage3D object. Inspect the Stage3D.context3D property to get the newly created Context3D object.

Related API Elements

Stage3D

### COPY

Constant

`public static const COPY:String = "copy"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5, Flash Lite 4

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.

Related API Elements

flash.display.InteractiveObject.copy

### CUT

Constant

`public static const CUT:String = "cut"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5, Flash Lite 4

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.

Related API Elements

flash.display.InteractiveObject.cut

### DEACTIVATE

Constant

`public static const DEACTIVATE:String = "deactivate"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.

Related API Elements

flash.events.EventDispatcher.deactivate
ACTIVATE

### DISPLAYING

Constant

`public static const DISPLAYING:String = "displaying"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Lite 4

The `Event.DISPLAYING` constant defines the value of the `type` property of a `displaying` 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.

This event has the following properties:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`
`currentTarget` | The object that is actively processing the Event object with an event listener.
`target` | The object that is about to be displayed.

Related API Elements

flash.display.NativeMenu.displaying
flash.display.NativeMenuItem.displaying

### ENTER_FRAME

Constant

`public static const ENTER_FRAME:String = "enterFrame"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.ENTER_FRAME` constant defines the value of the `type` property of an `enterFrame` 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.

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 `enterFrame` event.

Related API Elements

flash.display.DisplayObject.enterFrame

### EXIT_FRAME

Constant

`public static const EXIT_FRAME:String = "exitFrame"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.EXIT_FRAME` constant defines the value of the `type` property of an `exitFrame` 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.

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 `enterFrame` event.

Related API Elements

flash.display.DisplayObject.exitFrame

### EXITING

Constant

`public static const EXITING:String = "exiting"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Lite 4

The `Event.EXITING` constant defines the value of the `type` property of an `exiting` event object.

This event has the following properties:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `true`; canceling this event object stops the exit operation.
`currentTarget` | The NativeApplication object.
`target` | The NativeApplication object.

Related API Elements

flash.desktop.NativeApplication.exiting

### FRAME_CONSTRUCTED

Constant

`public static const FRAME_CONSTRUCTED:String = "frameConstructed"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.FRAME_CONSTRUCTED` constant defines the value of the `type` property of an `frameConstructed` 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.

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 `frameConstructed` event.

Related API Elements

flash.display.DisplayObject.frameConstructed

### FRAME_LABEL

Constant

`public static const FRAME_LABEL:String = "frameLabel"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 11.3, AIR 3.3

The `Event.FRAME_LABEL` constant defines the value of the `type` property of an `frameLabel` event object.

Note: This event has neither a "capture phase" nor a "bubble phase", which means that event listeners must be added directly to FrameLabel objects.

This event has the following properties:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The FrameLabel object that is actively processing the Event object with an event listener.
`target` | Any FrameLabel instance with a listener registered for the `frameLabel` event.

Related API Elements

flash.display.FrameLabel.frameLabel

### FULLSCREEN

Constant

`public static const FULLSCREEN:String = "fullScreen"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.FULL_SCREEN` constant defines the value of the `type` property of a `fullScreen` 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.

Related API Elements

flash.display.Stage.fullScreen

### HTML_BOUNDS_CHANGE

Constant

`public static const HTML_BOUNDS_CHANGE:String = "htmlBoundsChange"`

Runtime Versions: | AIR 1.0, Flash Lite 4

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.

Related API Elements

htmlBoundsChange event

### HTML_DOM_INITIALIZE

Constant

`public static const HTML_DOM_INITIALIZE:String = "htmlDOMInitialize"`

Runtime Versions: | AIR 1.0, Flash Lite 4

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.

Related API Elements

htmlDOMInitialize event

### HTML_RENDER

Constant

`public static const HTML_RENDER:String = "htmlRender"`

Runtime Versions: | AIR 1.0, Flash Lite 4

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.

Related API Elements

htmlRender event

### ID3

Constant

`public static const ID3:String = "id3"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.

Related API Elements

flash.media.Sound.id3

### INIT

Constant

`public static const INIT:String = "init"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.

Related API Elements

flash.display.LoaderInfo.init

### LOCATION_CHANGE

Constant

`public static const LOCATION_CHANGE:String = "locationChange"`

Runtime Versions: | AIR 1.0, Flash Lite 4

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.

Related API Elements

locationChange event

### MOUSE_LEAVE

Constant

`public static const MOUSE_LEAVE:String = "mouseLeave"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.

Related API Elements

flash.display.Stage.mouseLeave
flash.events.MouseEvent

### NETWORK_CHANGE

Constant

`public static const NETWORK_CHANGE:String = "networkChange"`

Runtime Versions: | AIR 1.0, Flash Lite 4

The `Event.NETWORK_CHANGE` constant defines the value of the `type` property of a `networkChange` 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 NativeApplication object.

Related API Elements

flash.desktop.NativeApplication.networkChange

### OPEN

Constant

`public static const OPEN:String = "open"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.OPEN` constant defines the value of the `type` property of an `open` 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 network object that has opened a connection.

Related API Elements

flash.display.LoaderInfo.open
flash.media.Sound.open
flash.net.FileReference.open
flash.net.URLLoader.open
flash.net.URLStream.open

### PASTE

Constant

`public static const PASTE:String = "paste"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5, Flash Lite 4

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` | `true` (`false` for AIR runtime.)
`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.

Related API Elements

flash.display.InteractiveObject.paste

### PREPARING

Constant

`public static const PREPARING:String = "preparing"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 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.

This event has the following properties:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`
`currentTarget` | The object that dispatched this event.
`target` | The object that dispatched this event.

Related API Elements

flash.display.NativeMenu.preparing
flash.display.NativeMenuItem.preparing

### REMOVED

Constant

`public static const REMOVED:String = "removed"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.REMOVED` constant defines the value of the `type` property of a `removed` 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 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.

Related API Elements

flash.display.DisplayObject.removed
ADDED
ADDED_TO_STAGE
REMOVED_FROM_STAGE

### REMOVED_FROM_STAGE

Constant

`public static const REMOVED_FROM_STAGE:String = "removedFromStage"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0, Flash Lite 4

The `Event.REMOVED_FROM_STAGE` constant defines the value of the `type` property of a `removedFromStage` 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 DisplayObject instance being removed from the on stage display list, either directly or through the removal of a sub tree in which the DisplayObject instance is contained. If the DisplayObject instance is being directly removed, the `removed` event occurs before this event.

Related API Elements

flash.display.DisplayObject.removedFromStage
ADDED
REMOVED
ADDED_TO_STAGE

### RENDER

Constant

`public static const RENDER:String = "render"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.RENDER` constant defines the value of the `type` property of a `render` 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.

This event has the following properties:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; the default behavior cannot be canceled.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`target` | Any DisplayObject instance with a listener registered for the `render` event.

Related API Elements

flash.display.DisplayObject.render
flash.display.Stage.invalidate()

### RESIZE

Constant

`public static const RESIZE:String = "resize"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.RESIZE` constant defines the value of the `type` property of a `resize` 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.

Related API Elements

flash.display.Stage.resize

### SCROLL

Constant

`public static const SCROLL:String = "scroll"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.

Related API Elements

flash.text.TextField.scroll
flash.html.HTMLLoader.scroll

### SELECT

Constant

`public static const SELECT:String = "select"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.
`target` | The object on which an item has been selected.

Related API Elements

flash.net.FileReference.select
flash.display.NativeMenu.select
flash.display.NativeMenuItem.select

### SELECT_ALL

Constant

`public static const SELECT_ALL:String = "selectAll"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5, Flash Lite 4

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.

Related API Elements

flash.display.InteractiveObject.selectAll

### SOUND_COMPLETE

Constant

`public static const SOUND_COMPLETE:String = "soundComplete"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.
`target` | The SoundChannel object in which a sound has finished playing.

Related API Elements

flash.media.SoundChannel.soundComplete

### STANDARD_ERROR_CLOSE

Constant

`public static const STANDARD_ERROR_CLOSE:String = "standardErrorClose"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 2, Flash Lite 4

The `Event.STANDARD_ERROR_CLOSE` constant defines the value of the `type` property of a `standardErrorClose` 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.

### STANDARD_INPUT_CLOSE

Constant

`public static const STANDARD_INPUT_CLOSE:String = "standardInputClose"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 2, Flash Lite 4

The `Event.STANDARD_INPUT_CLOSE` constant defines the value of the `type` property of a `standardInputClose` 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.

### STANDARD_OUTPUT_CLOSE

Constant

`public static const STANDARD_OUTPUT_CLOSE:String = "standardOutputClose"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 2, Flash Lite 4

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.

### SUSPEND

Constant

`public static const SUSPEND:String = "suspend"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.3

The `Event.SUSPEND` constant defines the value of the `type` property of an `suspend` event object. This event is dispatched only on AIR iOS.

This event has the following properties:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The NativeApplication object.
`target` | The NativeApplication object.

Related API Elements

flash.desktop.NativeApplication.suspend

### TAB_CHILDREN_CHANGE

Constant

`public static const TAB_CHILDREN_CHANGE:String = "tabChildrenChange"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.

Related API Elements

flash.display.InteractiveObject.tabChildrenChange

### TAB_ENABLED_CHANGE

Constant

`public static const TAB_ENABLED_CHANGE:String = "tabEnabledChange"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.TAB_ENABLED_CHANGE` constant defines the value of the `type` property of a `tabEnabledChange` 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 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.

Related API Elements

flash.display.InteractiveObject.tabEnabledChange

### TAB_INDEX_CHANGE

Constant

`public static const TAB_INDEX_CHANGE:String = "tabIndexChange"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

The `Event.TAB_INDEX_CHANGE` constant defines the value of the `type` property of a `tabIndexChange` 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 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.

Related API Elements

flash.display.InteractiveObject.tabIndexChange

### TEXT_INTERACTION_MODE_CHANGE

Constant

`public static const TEXT_INTERACTION_MODE_CHANGE:String = "textInteractionModeChange"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 11, Flash Lite 4

The `Event.TEXT_INTERACTION_MODE_CHANGE` constant defines the value of the `type` property of a `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.

Related API Elements

flash.text.TextField.textInteractionModeChange

### TEXTURE_READY

Constant

`public static const TEXTURE_READY:String = "textureReady"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 11.4, AIR 3.4

The `Event.TEXTURE_READY` constant defines the value of the `type` property of a `textureReady` event object. This event is dispatched by Texture and CubeTexture objects to signal the completion of an asynchronous upload. Request an asynchronous upload by using the `uploadCompressedTextureFromByteArray()` method on Texture or CubeTexture. This event neither bubbles nor is cancelable.

Related API Elements

Texture.uploadCompressedTextureFromByteArray()
CubeTexture.uploadCompressedTextureFromByteArray()

### UNLOAD

Constant

`public static const UNLOAD:String = "unload"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4

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.

Related API Elements

flash.display.LoaderInfo.unload

### USER_IDLE

Constant

`public static const USER_IDLE:String = "userIdle"`

Runtime Versions: | AIR 1.0, Flash Lite 4

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

This event has the following properties:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`target` | The NativeApplication object.

Related API Elements

flash.desktop.NativeApplication.userIdle

### USER_PRESENT

Constant

`public static const USER_PRESENT:String = "userPresent"`

Runtime Versions: | AIR 1.0, Flash Lite 4

The `Event.USER_PRESENT` constant defines the value of the `type` property of a `userPresent` event object.

This event has the following properties:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`target` | The NativeApplication object.

Related API Elements

flash.desktop.NativeApplication.userPresent

### VIDEO_FRAME

Constant

`public static const VIDEO_FRAME:String = "videoFrame"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 11.4, AIR 3.4

The `Event.VIDEO_FRAME` constant defines the value of the `type` property of a `videoFrame` event object.

This event has the following properties:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`target` | The Camera object that dispatched this event.

Related API Elements

flash.media.Camera

### WORKER_STATE

Constant

`public static const WORKER_STATE:String = "workerState"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 11.4, AIR 3.4

The `Event.WORKER_STATE` constant defines the value of the `type` property of a `workerState` 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 object that dispatched this event.

Related API Elements

flash.system.Worker.workerState
Examples How to use this example
EventExample.as
The following example uses the `EventExample` class and the `Square` custom class to demonstrate how to manage event bubbling.
Copy

    package {
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.MouseEvent;

        public class EventExample extends Sprite {

            public function EventExample() {
                var square_0:Square = new Square(300, 0x336633);
                addChild(square_0);

                var square_1:Square = new Square(250, 0x669966);
                square_0.addChild(square_1);

                var square_2:Square = new Square(200, 0x66CC66);
                square_1.addChild(square_2);

                var square_3:Square = new Square(150, 0xAA0000);
                square_3.shouldBubble = false;
                square_2.addChild(square_3);

                var square_4:Square = new Square(100, 0x66FF66);
                square_3.addChild(square_4);

                var square_5:Square = new Square(50, 0xCC0000);
                square_5.shouldBubble = false;
                square_4.addChild(square_5);

                this.addEventListener(MouseEvent.CLICK, clickHandler);
            }

            private function clickHandler(e:Event):void {
                trace(">> stage: " + e.type + " event from " + e.target.name + " called on " + this.name);
                trace(">> --------------------------------------------");
            }
        }
    }

    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;

    class Square extends Sprite {
        private var sideLen:int;
        private var color:Number;
        public var shouldBubble:Boolean = true;

        public function Square(sideLen:int, color:Number) {
            this.sideLen = sideLen;
            this.color = color;
            init();
            draw();
        }

        private function init():void {
            buttonMode = true;
            this.addEventListener(MouseEvent.CLICK, firstClickHandler);
            this.addEventListener(MouseEvent.CLICK, secondClickHandler);
            this.addEventListener(MouseEvent.CLICK, thirdClickHandler);
        }

        private function draw():void {
            this.graphics.beginFill(color);
            this.graphics.drawRect(0, 0, sideLen, sideLen);
        }

        private function firstClickHandler(e:Event):void {
            trace(">> 1e: " + e.type + " event from " + e.target.name + " called on " + this.name);
            if(!shouldBubble) {
                e.stopPropagation();
            }
        }

        private function secondClickHandler(e:Event):void {
            trace(">> 2e: " + e.type + " event from " + e.target.name + " called on " + this.name);
            if(!shouldBubble) {
                e.stopImmediatePropagation();
                trace(">> --------------------------------------------");
            }
        }

        private function thirdClickHandler(e:Event):void {
            trace(">> 3e: " + e.type + " event from " + e.target.name + " called on " + this.name);
        }
    }

EventExample2.as
The following example creates an interactive demonstration of the difference between `ADDED` and `ADDED_TO_STAGE` events, as well as the difference between `REMOVED` and `REMOVED_FROM_STAGE` events. Clicking a sprite will remove it from the stage as well as everything nested within it. For example, clicking the largest sprite will cause a `REMOVED` event as well as three `REMOVED_FROM_STAGE` events to fire.
Copy

     package {
        import flash.display.Sprite;
        import flash.events.*;

        public class EventExample2 extends Sprite {
            public function EventExample2():void {
                var parentSprite:Sprite = createSprite("parentSprite",200);
                var childSprite:Sprite = createSprite("childSprite",100);
                var childOfChildSprite:Sprite = createSprite("childOfChildSprite",50);

                trace(":: Adding to Stage ::");
                this.addChild(parentSprite);
                trace(":: Adding to Stage ::");
                parentSprite.addChild(childSprite);
                trace(":: Adding to Stage ::");
                childSprite.addChild(childOfChildSprite);
            }
            private function createSprite(name:String,size:uint):Sprite {
                trace(":: Creating Sprite ::");
                var newSprite:Sprite = new Sprite();
                newSprite.name = name;
                newSprite.graphics.beginFill(0xFFFFFF * Math.random(),1);
                newSprite.graphics.drawRect(0,0,size,size);
                newSprite.graphics.endFill();
                newSprite.addEventListener(Event.ADDED, spriteAdded);
                newSprite.addEventListener(Event.ADDED_TO_STAGE, spriteAddedToStage);
                newSprite.addEventListener(Event.REMOVED, spriteRemoved);
                newSprite.addEventListener(Event.REMOVED_FROM_STAGE, spriteRemovedFromStage);
                newSprite.addEventListener(MouseEvent.CLICK, remove);
                return newSprite;
            }
            private function remove(event:Event) {
                if(event.target == event.currentTarget) {
                    trace(":: Removing Clicked Sprite ::");
                    var target:Sprite = Sprite(event.target);
                    target.parent.removeChild(target);
                }
            }
            private function spriteRemovedFromStage(event:Event):void {
                trace("REMOVED_FROM_STAGE: " + event.target.name + " : " + event.currentTarget.name);
            }
            private function spriteRemoved(event:Event):void {
                trace("REMOVED: " + event.target.name + " from " + event.currentTarget.name);
            }
            private function spriteAddedToStage(event:Event):void {
                trace("ADDED_TO_STAGE: " + event.target.name + " : " + event.currentTarget.name);
            }
            private function spriteAdded(event:Event):void {
                trace("ADDED: " + event.target.name + " within " + event.currentTarget.name);
            }
        }
    }

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00