The Event object is used as as parameters to event listeners when an event occurs.

The properties of the Event object 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. 


The methods of the Event object 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.


Can be created using method new:

Lib.Media.Events.Event.new(type, bubbles, cancelable)

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

type - The type of the event, accessible as Event.type, string.

bubbles - (default = false) - Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false. 

cancelable - (default = false) - Determines whether the Event object can be canceled. The default values is false.


Created Event object has properties:

bubbles

Indicates whether an event is a bubbling event.

read-only, true/false

cancelable

Indicates whether the behavior associated with the event can be prevented.

read-only, true/false

currentTarget

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

read-only, object

eventPhase

The current phase in the event flow.

read-only, int

target

The event target.

read-only, object

type

The type of event.

read-only, string


methods:

clone()

Duplicates an instance of an Event subclass.


stopImmediatePropagation()

Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow.


stopPropagation()

Prevents processing of any event listeners in nodes subsequent to the current node in the event flow.


toString()

Returns a string containing all the properties of the Event object.



Event types:

Lib.Media.Events.Event.ACTIVATE

The ACTIVATE constant defines the value of the type property of an activate event object.

Lib.Media.Events.Event.ADDED

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

Lib.Media.Events.Event.ADDED_TO_STAGE

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

Lib.Media.Events.Event.CANCEL

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

Lib.Media.Events.Event.CHANGE

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

Lib.Media.Events.Event.BEFORE_CLOSE

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

Lib.Media.Events.Event.CLOSE

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

Lib.Media.Events.Event.COMPLETE

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

Lib.Media.Events.Event.CONNECT

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

Lib.Media.Events.Event.CONTEXT3D_CREATE

The Event.CONTEXT3D_CREATE constant defines the value of the type property of a context3Dcreate event object.

Lib.Media.Events.Event.CONTEXT3D_LOST

The Event.CONTEXT3D_LOST constant defines the value of the type property of a context3D object.

Lib.Media.Events.Event.DEACTIVATE

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

Lib.Media.Events.Event.ENTER_FRAME

The Event.ENTER_FRAME constant defines the value of the type property of an enterFrame event object.

Lib.Media.Events.Event.ID3

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

Lib.Media.Events.Event.INIT

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

Lib.Media.Events.Event.MOUSE_LEAVE

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

Lib.Media.Events.Event.OPEN

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

Lib.Media.Events.Event.REMOVED

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

Lib.Media.Events.Event.REMOVED_FROM_STAGE

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

Lib.Media.Events.Event.RENDER

The Event.RENDER constant defines the value of the type property of a render event object.

Lib.Media.Events.Event.RESIZE

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

Lib.Media.Events.Event.SCROLL

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

Lib.Media.Events.Event.SELECT

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

Lib.Media.Events.Event.SOUND_COMPLETE

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

Lib.Media.Events.Event.TAB_CHILDREN_CHANGE

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

Lib.Media.Events.Event.TAB_ENABLED_CHANGE

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

Lib.Media.Events.Event.TAB_INDEX_CHANGE

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

Lib.Media.Events.Event.UNLOAD

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

Lib.Media.Events.Event.VIDEO_FRAME

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




Created with the Personal Edition of HelpNDoc: Easily create HTML Help documents