Pacoteflash.events
Classepublic class Event
HerançaEvent Inheritance Object
Subclasses ActivityEvent, ADGHeaderShiftEvent, ADGItemSelectEvent, AdvancedDataGridEvent, AIREvent, AutomationEvent, AutomationRecordEvent, AutomationReplayEvent, BrowserChangeEvent, CalendarLayoutChangeEvent, ChannelEvent, ChartSelectionChangeEvent, ChildExistenceChangedEvent, CloseEvent, CollectionEvent, ColorPickerEvent, ContextMenuEvent, CubeEvent, CuePointEvent, DataGridEvent, DateChooserEvent, DividerEvent, DRMAuthenticateEvent, DropdownEvent, DynamicEvent, EffectEvent, FileEvent, FileListEvent, FlexEvent, FlexNativeMenuEvent, FocusEvent, HTMLUncaughtJavaScriptExceptionEvent, HTTPStatusEvent, IndexChangedEvent, InvokeEvent, ItemClickEvent, KeyboardEvent, ListEvent, ListItemSelectEvent, LogEvent, MenuShowEvent, MessageEvent, MessageFaultEvent, MetadataEvent, MouseEvent, MoveEvent, NativeWindowBoundsEvent, NativeWindowDisplayStateEvent, NetStatusEvent, NumericStepperEvent, OutputProgressEvent, ProgressEvent, PropertyChangeEvent, ResizeEvent, ScrollEvent, SliderEvent, SQLEvent, SQLUpdateEvent, StateChangeEvent, StatusEvent, SyncEvent, TextEvent, TextSelectionEvent, TimerEvent, ToolTipEvent, TreeEvent, TweenEvent, ValidationResultEvent, VideoEvent

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. Eventos associated with a mouse click, for exemplo, 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. Eventos 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 exemplo, 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 stopPropogation() or stopImmediatePropogation() method.

Veja Exemplos

Veja também

flash.events.EventDispatcher


Propriedades Públicas
 PropriedadeDefinido por
  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
 Inheritedconstructor : 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
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  target : Object
[read-only] The event target.
Event
  type : String
[read-only] The type of event.
Event
Métodos Públicos
 MétodoDefinido por
  
Event(type:String, bubbles:Boolean = false, cancelable:Boolean = false)
Creates an Event object to pass as a parameter to event listeners.
Event
  
Duplicates an instance of an Event subclass.
Event
  
formatToString(className:String, ... arguments):String
A utility function for implementing the toString() method in your custom Event class.
Event
 Inherited
Indicates whether an object has a specified property defined.
Object
  
Checks whether the preventDefault() method has been called on the event.
Event
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
Cancels an event's default behavior if that behavior can be canceled.
Event
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow.
Event
  
Prevents processing of any event listeners in nodes subsequent to the current node in the event flow.
Event
  
Returns a string containing all the properties of the Event object.
Event
 Inherited
Returns the primitive value of the specified object.
Object
Constantes públicas
 ConstanteDefinido por
  ACTIVATE : String = "activate"
[static] The Event.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 defines the value of the type property of an addedToStage 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 defines the value of the type property of a change 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
  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] 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
  EXITING : String = "exiting"
[static] The Event.EXITING constant defines the value of the type property of a exiting 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 a 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
  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
  SOUND_COMPLETE : String = "soundComplete"
[static] The Event.SOUND_COMPLETE constant defines the value of the type property of a soundComplete 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
  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
Detalhes da propriedade
bubblespropriedade
bubbles:Boolean  [read-only]

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.


Implementação
    public function get bubbles():Boolean
cancelablepropriedade 
cancelable:Boolean  [read-only]

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.


Implementação
    public function get cancelable():Boolean

Veja também

currentTargetpropriedade 
currentTarget:Object  [read-only]

The object that is actively processing the Event object with an event listener. For exemplo, 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.


Implementação
    public function get currentTarget():Object
eventPhasepropriedade 
eventPhase:uint  [read-only]

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


Implementação
    public function get eventPhase():uint
targetpropriedade 
target:Object  [read-only]

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


Implementação
    public function get target():Object
typepropriedade 
type:String  [read-only]

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


Implementação
    public function get type():String
Detalhes do construtor
Event()Construtor
public function Event(type:String, bubbles:Boolean = false, cancelable:Boolean = false)

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

Parâmetros
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.
Detalhes do método
clone()método
public function clone():Event

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 exemplo, 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);
     }
  }
  

Retorna
Event — A new Event object that is identical to the original.
formatToString()método 
public function formatToString(className:String, ... arguments):String

A utility function for implementing the toString() method in your custom Event class. 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"); 
     }
  }
  

Parâmetros

className:String — The name of your custom Event class. In the previous exemplo, 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 exemplo, the ...arguments parameter includes type, bubbles, cancelable, eventPhase, and URL.

Retorna
String — The name of your custom Event class and the String value of your ...arguments parameter.
isDefaultPrevented()método 
public function isDefaultPrevented():Boolean

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

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

Veja também

preventDefault()método 
public function preventDefault():void

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

Many events have associated behaviors that are carried out by default. For exemplo, 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 exemplo 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.

Veja também

stopImmediatePropagation()método 
public function stopImmediatePropagation():void

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.

Veja também

stopPropagation()método 
public function stopPropagation():void

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.

Veja também

toString()método 
public function toString():String

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]

Retorna
String — A string containing all the properties of the Event object.
Detalhes da constante
ACTIVATEConstante
public static const ACTIVATE:String = "activate"

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

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

Veja também

ADDEDConstante 
public static const ADDED:String = "added"

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

This event has the following properties:

PropriedadeValor
bubblestrue
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe 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.

Veja também

ADDED_TO_STAGEConstante 
public static const ADDED_TO_STAGE:String = "addedToStage"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe 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.

Veja também

CANCELConstante 
public static const CANCEL:String = "cancel"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetA reference to the object on which the operation is canceled.

Veja também

CHANGEConstante 
public static const CHANGE:String = "change"

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

This event has the following properties:

PropriedadeValor
bubblestrue
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe 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.

Veja também

CLOSEConstante 
public static const CLOSE:String = "close"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object whose connection has been closed.

Veja também

CLOSINGConstante 
public static const CLOSING:String = "closing"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelabletrue; canceling this event object stops the close operation.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object whose connection is to be closed.

Veja também

COMPLETEConstante 
public static const COMPLETE:String = "complete"

The Event.COMPLETE constant defines the value of the type property of a complete event object.

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe network object that has completed loading.

Veja também

CONNECTConstante 
public static const CONNECT:String = "connect"

The Event.CONNECT constant defines the value of the type property of a connect event object.

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe Socket or XMLSocket object that has established a network connection.

Veja também

DEACTIVATEConstante 
public static const DEACTIVATE:String = "deactivate"

The Event.DEACTIVATE constant defines the value of the type property of a deactivate 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:

PropriedadeValor
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 DEACTIVATE event.

Veja também

DISPLAYINGConstante 
public static const DISPLAYING:String = "displaying"

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:

PropriedadeValor
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object that is about to be displayed.

Veja também

ENTER_FRAMEConstante 
public static const ENTER_FRAME:String = "enterFrame"

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

PropriedadeValor
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 ENTER_FRAME event.

Veja também

EXITINGConstante 
public static const EXITING:String = "exiting"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelabletrue; canceling this event object stops the exit operation.
currentTargetThe Shell object.
targetThe Shell object.

Veja também

flash.desktop.Shell.exiting
FULLSCREENConstante 
public static const FULLSCREEN:String = "fullScreen"

The Event.FULL_SCREEN constant defines the value of the type property of a fullScreen event object.

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe Stage object.

Veja também

HTML_BOUNDS_CHANGEConstante 
public static const HTML_BOUNDS_CHANGE:String = "htmlBoundsChange"

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

Signals the one or both of the contentWidth and contentHeight properties of an HTMLLoader object have changed.

Veja também

HTML_DOM_INITIALIZEConstante 
public static const HTML_DOM_INITIALIZE:String = "htmlDOMInitialize"

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

Signals that the HTML DOM in and HTMLLoader object has be created in response to a load operation.

Veja também

HTML_RENDERConstante 
public static const HTML_RENDER:String = "htmlRender"

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

Signals that the rendering of content in an HTMLLoader object is fully up-to-date.

Veja também

ID3Constante 
public static const ID3:String = "id3"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe 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.

Veja também

INITConstante 
public static const INIT:String = "init"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe LoaderInfo object associated with the SWF file being loaded.

Veja também

LOCATION_CHANGEConstante 
public static const LOCATION_CHANGE:String = "locationChange"

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

Signals the location property of an HTMLLoader object has changed.

Veja também

MOUSE_LEAVEConstante 
public static const MOUSE_LEAVE:String = "mouseLeave"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe 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.

Veja também

NETWORK_CHANGEConstante 
public static const NETWORK_CHANGE:String = "networkChange"

The Event.NETWORK_CHANGE constant defines the value of the type property of a networkChange event object.

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe Shell object.

Veja também

OPENConstante 
public static const OPEN:String = "open"

The Event.OPEN constant defines the value of the type property of an open event object.

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe network object that has opened a connection.

Veja também

REMOVEDConstante 
public static const REMOVED:String = "removed"

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

This event has the following properties:

PropriedadeValor
bubblestrue
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe 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.

Veja também

REMOVED_FROM_STAGEConstante 
public static const REMOVED_FROM_STAGE:String = "removedFromStage"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe 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.

Veja também

RENDERConstante 
public static const RENDER:String = "render"

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

PropriedadeValor
bubblesfalse
cancelablefalse; the default behavior cannot be canceled.
currentTargetThe object that is actively processing the Event object with an event listener.
targetAny DisplayObject instance with a listener registered for the RENDER event.

Veja também

RESIZEConstante 
public static const RESIZE:String = "resize"

The Event.RESIZE constant defines the value of the type property of a resize event object.

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe Stage object.

Veja também

SCROLLConstante 
public static const SCROLL:String = "scroll"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe TextField object that has been scrolled. 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.

Veja também

SELECTConstante 
public static const SELECT:String = "select"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object on which an item has been selected.

Veja também

SOUND_COMPLETEConstante 
public static const SOUND_COMPLETE:String = "soundComplete"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe Sound object on which a sound has finished playing.

Veja também

TAB_CHILDREN_CHANGEConstante 
public static const TAB_CHILDREN_CHANGE:String = "tabChildrenChange"

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

This event has the following properties:

PropriedadeValor
bubblestrue
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe 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.

Veja também

TAB_ENABLED_CHANGEConstante 
public static const TAB_ENABLED_CHANGE:String = "tabEnabledChange"

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

This event has the following properties:

PropriedadeValor
bubblestrue
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe 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.

Veja também

TAB_INDEX_CHANGEConstante 
public static const TAB_INDEX_CHANGE:String = "tabIndexChange"

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

This event has the following properties:

PropriedadeValor
bubblestrue
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe 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.

Veja também

UNLOADConstante 
public static const UNLOAD:String = "unload"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe LoaderInfo object associated with the SWF file being unloaded or replaced.

Veja também

USER_IDLEConstante 
public static const USER_IDLE:String = "userIdle"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
targetThe Shell object.

Veja também

USER_PRESENTConstante 
public static const USER_PRESENT:String = "userPresent"

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

This event has the following properties:

PropriedadeValor
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
targetThe Shell object.

Veja também

Exemplos How to use examples
EventExample.as

The following exemplo uses the EventExample class and the Square custom class to demonstrate how to manage event bubbling.
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 exemplo 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 exemplo, clicking the largest sprite will cause a REMOVED event as well as three REMOVED_FROM_STAGE events to fire.
 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);
        }
    }
}