Packageflash.events
Classpublic class Event
InheritanceEvent Inheritance Object
Subclasses HTTPStatusEvent, TimerEvent

Language Version : ActionScript 3.0
Runtime Versions : Flash Player 9, AIR 1.0

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.

TODO



Public Properties
 PropertyDefined By
  bubbles : Boolean
[read-only] Indicates whether an event is a bubbling event.
Event
  cancelable : Boolean
[read-only]
Event
  currentTarget : Object
[read-only]
Event
  eventPhase : uint
[read-only]
Event
  target : Object
[read-only]
Event
  type : String
[read-only]
Event
Public Methods
 MethodDefined By
  
Event(type:String, bubbles:Boolean = false, cancelable:Boolean = false)
Creates an Event object to pass as a parameter to event listeners.
Event
 Inherited
_init():*
[static]
_init
  
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
 Inherited
AS3
 Inherited
init():*
[static]
init
  
Checks whether the preventDefault() method has been called on the event.
Event
 Inherited
AS3
  
Cancels an event's default behavior if that behavior can be canceled.
Event
 Inherited
AS3
  
Event
  
Event
  
Returns a string containing all the properties of the Event object.
Event
Protected Methods
 MethodDefined By
 Inherited
[static]
protected
 Inherited
_setPropertyIsEnumerable(o:*, V:String, enumerable:Boolean):void
[static]
protected
Public Constants
 ConstantDefined 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]
Event
  ADDED_TO_STAGE : String = "addedToStage"
[static]
Event
  CANCEL : String = "cancel"
[static]
Event
  CHANGE : String = "change"
[static]
Event
  CHANNEL_MESSAGE : String = "channelMessage"
[static]
Event
  CHANNEL_STATE : String = "channelState"
[static]
Event
  CLEAR : String = "clear"
[static]
Event
  CLOSE : String = "close"
[static]
Event
  CLOSING : String = "closing"
[static]
Event
  COMPLETE : String = "complete"
[static]
Event
  CONNECT : String = "connect"
[static]
Event
  CONTEXT3D_CREATE : String = "context3DCreate"
[static]
Event
  COPY : String = "copy"
[static]
Event
  CUT : String = "cut"
[static]
Event
  DEACTIVATE : String = "deactivate"
[static]
Event
  DISPLAYING : String = "displaying"
[static]
Event
  ENTER_FRAME : String = "enterFrame"
[static]
Event
  EXIT_FRAME : String = "exitFrame"
[static]
Event
  EXITING : String = "exiting"
[static]
Event
  FRAME_CONSTRUCTED : String = "frameConstructed"
[static]
Event
  FRAME_LABEL : String = "frameLabel"
[static]
Event
  FULLSCREEN : String = "fullScreen"
[static]
Event
  HTML_BOUNDS_CHANGE : String = "htmlBoundsChange"
[static]
Event
  HTML_DOM_INITIALIZE : String = "htmlDOMInitialize"
[static]
Event
  HTML_RENDER : String = "htmlRender"
[static]
Event
  ID3 : String = "id3"
[static]
Event
  INIT : String = "init"
[static]
Event
 Inheritedlength : int = 1
[static]
length
  LOCATION_CHANGE : String = "locationChange"
[static]
Event
  MOUSE_LEAVE : String = "mouseLeave"
[static]
Event
  NETWORK_CHANGE : String = "networkChange"
[static]
Event
  OPEN : String = "open"
[static]
Event
  PASTE : String = "paste"
[static]
Event
  PREPARING : String = "preparing"
[static]
Event
  REMOVED : String = "removed"
[static]
Event
  REMOVED_FROM_STAGE : String = "removedFromStage"
[static]
Event
  RENDER : String = "render"
[static]
Event
  RESIZE : String = "resize"
[static]
Event
  SCROLL : String = "scroll"
[static]
Event
  SELECT : String = "select"
[static]
Event
  SELECT_ALL : String = "selectAll"
[static]
Event
  SOUND_COMPLETE : String = "soundComplete"
[static]
Event
  STANDARD_ERROR_CLOSE : String = "standardErrorClose"
[static]
Event
  STANDARD_INPUT_CLOSE : String = "standardInputClose"
[static]
Event
  STANDARD_OUTPUT_CLOSE : String = "standardOutputClose"
[static]
Event
  SUSPEND : String = "suspend"
[static]
Event
  TAB_CHILDREN_CHANGE : String = "tabChildrenChange"
[static]
Event
  TAB_ENABLED_CHANGE : String = "tabEnabledChange"
[static]
Event
  TAB_INDEX_CHANGE : String = "tabIndexChange"
[static]
Event
  TEXT_INTERACTION_MODE_CHANGE : String = "textInteractionModeChange"
[static]
Event
  TEXTURE_READY : String = "textureReady"
[static]
Event
  UNLOAD : String = "unload"
[static]
Event
  USER_IDLE : String = "userIdle"
[static]
Event
  USER_PRESENT : String = "userPresent"
[static]
Event
  VIDEO_FRAME : String = "videoFrame"
[static]
Event
  WORKER_STATE : String = "workerState"
[static]
Event
Property Detail
bubblesproperty
bubbles:Boolean  [read-only]

Language Version : ActionScript 3.0
Runtime Versions : Flash Player 9, AIR 1.0

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


Implementation
    public function get bubbles():Boolean
cancelableproperty 
cancelable:Boolean  [read-only]


Implementation
    public function get cancelable():Boolean
currentTargetproperty 
currentTarget:Object  [read-only]


Implementation
    public function get currentTarget():Object
eventPhaseproperty 
eventPhase:uint  [read-only]


Implementation
    public function get eventPhase():uint
targetproperty 
target:Object  [read-only]


Implementation
    public function get target():Object
typeproperty 
type:String  [read-only]


Implementation
    public function get type():String
Constructor Detail
Event()Constructor
public function Event(type:String, bubbles:Boolean = false, cancelable:Boolean = false)

Language Version : ActionScript 3.0
Runtime Versions : Flash Player 9, AIR 1.0

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 : Flash Player 9, AIR 1.0

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.

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

Example
In this example, PingEvent is a subclass of Event and therefore implements its own version of clone().
                 class PingEvent extends Event
                 {
                     var URL:String;
         
                     public override function clone():Event
                     {
                         return new PingEvent( type, bubbles, cancelable, URL);
                     }
                 }
         
formatToString()method 
public function formatToString(className:String, ... arguments):String

Language Version : ActionScript 3.0
Runtime Versions : Flash Player 9, AIR 1.0

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 : Flash Player 9, AIR 1.0

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.

See also

preventDefault()
preventDefault()method 
public function preventDefault():void

Language Version : ActionScript 3.0
Runtime Versions : Flash Player 9, 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 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.

See also

stopImmediatePropagation()method 
public function stopImmediatePropagation():void

stopPropagation()method 
public function stopPropagation():void

toString()method 
public function toString():String

Language Version : ActionScript 3.0
Runtime Versions : Flash Player 9, AIR 1.0

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
ACTIVATEConstant
public static const ACTIVATE:String = "activate"

Language Version : ActionScript 3.0
Runtime Versions : Flash Player 9, AIR 1.0

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:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetAny DisplayObject instance with a listener registered for the activate event.

See also

ADDEDConstant 
public static const ADDED:String = "added"

ADDED_TO_STAGEConstant 
public static const ADDED_TO_STAGE:String = "addedToStage"

CANCELConstant 
public static const CANCEL:String = "cancel"

CHANGEConstant 
public static const CHANGE:String = "change"

CHANNEL_MESSAGEConstant 
public static const CHANNEL_MESSAGE:String = "channelMessage"

CHANNEL_STATEConstant 
public static const CHANNEL_STATE:String = "channelState"

CLEARConstant 
public static const CLEAR:String = "clear"

CLOSEConstant 
public static const CLOSE:String = "close"

CLOSINGConstant 
public static const CLOSING:String = "closing"

COMPLETEConstant 
public static const COMPLETE:String = "complete"

CONNECTConstant 
public static const CONNECT:String = "connect"

CONTEXT3D_CREATEConstant 
public static const CONTEXT3D_CREATE:String = "context3DCreate"

COPYConstant 
public static const COPY:String = "copy"

CUTConstant 
public static const CUT:String = "cut"

DEACTIVATEConstant 
public static const DEACTIVATE:String = "deactivate"

DISPLAYINGConstant 
public static const DISPLAYING:String = "displaying"

ENTER_FRAMEConstant 
public static const ENTER_FRAME:String = "enterFrame"

EXIT_FRAMEConstant 
public static const EXIT_FRAME:String = "exitFrame"

EXITINGConstant 
public static const EXITING:String = "exiting"

FRAME_CONSTRUCTEDConstant 
public static const FRAME_CONSTRUCTED:String = "frameConstructed"

FRAME_LABELConstant 
public static const FRAME_LABEL:String = "frameLabel"

FULLSCREENConstant 
public static const FULLSCREEN:String = "fullScreen"

HTML_BOUNDS_CHANGEConstant 
public static const HTML_BOUNDS_CHANGE:String = "htmlBoundsChange"

HTML_DOM_INITIALIZEConstant 
public static const HTML_DOM_INITIALIZE:String = "htmlDOMInitialize"

HTML_RENDERConstant 
public static const HTML_RENDER:String = "htmlRender"

ID3Constant 
public static const ID3:String = "id3"

INITConstant 
public static const INIT:String = "init"

LOCATION_CHANGEConstant 
public static const LOCATION_CHANGE:String = "locationChange"

MOUSE_LEAVEConstant 
public static const MOUSE_LEAVE:String = "mouseLeave"

NETWORK_CHANGEConstant 
public static const NETWORK_CHANGE:String = "networkChange"

OPENConstant 
public static const OPEN:String = "open"

PASTEConstant 
public static const PASTE:String = "paste"

PREPARINGConstant 
public static const PREPARING:String = "preparing"

REMOVEDConstant 
public static const REMOVED:String = "removed"

REMOVED_FROM_STAGEConstant 
public static const REMOVED_FROM_STAGE:String = "removedFromStage"

RENDERConstant 
public static const RENDER:String = "render"

RESIZEConstant 
public static const RESIZE:String = "resize"

SCROLLConstant 
public static const SCROLL:String = "scroll"

SELECTConstant 
public static const SELECT:String = "select"

SELECT_ALLConstant 
public static const SELECT_ALL:String = "selectAll"

SOUND_COMPLETEConstant 
public static const SOUND_COMPLETE:String = "soundComplete"

STANDARD_ERROR_CLOSEConstant 
public static const STANDARD_ERROR_CLOSE:String = "standardErrorClose"

STANDARD_INPUT_CLOSEConstant 
public static const STANDARD_INPUT_CLOSE:String = "standardInputClose"

STANDARD_OUTPUT_CLOSEConstant 
public static const STANDARD_OUTPUT_CLOSE:String = "standardOutputClose"

SUSPENDConstant 
public static const SUSPEND:String = "suspend"

TAB_CHILDREN_CHANGEConstant 
public static const TAB_CHILDREN_CHANGE:String = "tabChildrenChange"

TAB_ENABLED_CHANGEConstant 
public static const TAB_ENABLED_CHANGE:String = "tabEnabledChange"

TAB_INDEX_CHANGEConstant 
public static const TAB_INDEX_CHANGE:String = "tabIndexChange"

TEXT_INTERACTION_MODE_CHANGEConstant 
public static const TEXT_INTERACTION_MODE_CHANGE:String = "textInteractionModeChange"

TEXTURE_READYConstant 
public static const TEXTURE_READY:String = "textureReady"

UNLOADConstant 
public static const UNLOAD:String = "unload"

USER_IDLEConstant 
public static const USER_IDLE:String = "userIdle"

USER_PRESENTConstant 
public static const USER_PRESENT:String = "userPresent"

VIDEO_FRAMEConstant 
public static const VIDEO_FRAME:String = "videoFrame"

WORKER_STATEConstant 
public static const WORKER_STATE:String = "workerState"