Event
Description
Event objects are passed as parameters to event listeners when an event occurs.
This is Loom's version of the Flash Event class.
EventDispatchers create instances of this class and send them to registered listeners. An event object contains information that characterizes an event, most importantly the event type and if the event bubbles. The target of an event is the object that dispatched it.
For some event types, this information is sufficient; other events may need additional information to be carried to the listener. In that case, you can subclass "Event" and add properties with all the information you require. The "EnterFrameEvent" is an example for this practice; it adds a property about the time that has passed since the last frame.
Furthermore, the event class contains methods that can stop the event from being processed by other listeners - either completely or at the next bubble stage.
See also:
loom2d.events.EventDispatcher
API overview
Constructor
Event
(
type: String
,
bubbles: Boolean
= false
,
data: Object
= null
)
Creates an event object that can be passed to listeners
Attributes
Public attributes
| bubbles: Boolean |
read-only
Indicates if event will bubble |
| currentTarget: EventDispatcher |
read-only
The object the event is currently bubbling at |
| data: Object |
read-only
Arbitrary data that is attached to the event |
| target: EventDispatcher |
read-only
The object that dispatched the event |
| type: String |
read-only
A string that identifies the event |
Constants
Constants
| ADDED: String |
static
Event type for a display object that is added to a parent |
| ADDED_TO_STAGE: String |
static
Event type for a display object that is added to the stage |
| CANCEL: String |
static
An event type to be utilized in custom events |
| CHANGE: String |
static
An event type to be utilized in custom events |
| CLOSE: String |
static
An event type to be utilized in custom events |
| COMPLETE: String |
static
Event type that may be used whenever something finishes |
| CONTEXT3D_CREATE: String |
static
Event type for a (re)created stage3D rendering context |
| ENTER_FRAME: String |
static
Event type for a display object that is entering a new frame |
| FLATTEN: String |
static
Event type for a display object that is being flattened |
| OPEN: String |
static
An event type to be utilized in custom events |
| REMOVED: String |
static
Event type for a display object that is removed from its parent |
| REMOVED_FROM_STAGE: String |
static
Event type for a display object that is removed from the stage |
| REMOVE_FROM_JUGGLER: String |
static
Event type for an animated object that requests to be removed from the juggler |
| RESIZE: String |
static
Event type for a resized Flash Player |
| ROOT_CREATED: String |
static
Event type that indicates that the root DisplayObject has been created |
| SCROLL: String |
static
An event type to be utilized in custom events |
| SELECT: String |
static
An event type to be utilized in custom events |
| TRIGGERED: String |
static
Event type for a triggered button |
Functions
Public functions
| clone (): Event |
Clones the event object with the same arguments and returns the duplicate |
| stopImmediatePropagation (): Void |
Prevents any other listeners from receiving the event |
| stopPropagation (): Void |
Prevents listeners at the next bubble stage from receiving the event |
Constructor
Attributes
Constants
CANCEL: String
static
An event type to be utilized in custom events. Not used by Starling right now.
CHANGE: String
static
An event type to be utilized in custom events. Not used by Starling right now.
REMOVE_FROM_JUGGLER: String
static
Event type for an animated object that requests to be removed from the juggler.
SCROLL: String
static
An event type to be utilized in custom events. Not used by Starling right now.
SELECT: String
static
An event type to be utilized in custom events. Not used by Starling right now.
Functions
clone (): Event
Clones the event object with the same arguments and returns the duplicate.
Returns
| Event | The duplicate event object that was cloned. |
getFullTypeName
(): String
Inherited from Object
native
Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.
Returns
| String | fully qualified type name of the Object. |
getType
(): Type
Inherited from Object
native
Gets the Type that describes the Object.
Returns
| Type | The Type that describes the object. |