Creates a new TouchEvent instance.
Indicates if event will bubble.
Indicates if the ctrl key was pressed when the event occurred. (Mac OS: Cmd or Ctrl)
The object the event is currently bubbling at.
Arbitrary data that is attached to the event.
Indicates if the shift key was pressed when the event occurred.
The object that dispatched the event.
The time the event occurred (in seconds since application launch).
All touches that are currently available.
A string that identifies the event.
Event type for a display object that is added to a parent.
Event type for a display object that is added to the stage
An event type to be utilized in custom events. Not used by Starling right now.
An event type to be utilized in custom events. Not used by Starling right now.
An event type to be utilized in custom events. Not used by Starling right now.
Event type that may be used whenever something finishes.
Event type for a (re)created stage3D rendering context.
Event type for a display object that is entering a new frame.
Event type that is dispatched by the Starling instance when it encounters a problem from which it cannot recover, e.g. a lost device context.
Event type that is dispatched by the AssetManager when a file/url cannot be loaded.
An event type to be utilized in custom events. Not used by Starling right now.
Event type that is dispatched by the AssetManager when an xml or json file couldn't be parsed.
An event type to be utilized in custom events. Not used by Starling right now.
Event type for a display object that is removed from its parent.
Event type for a display object that is removed from the stage.
Event type for an animated object that requests to be removed from the juggler.
Event type that is dispatched by the Starling instance directly before rendering.
Event type for a resized Flash Player.
Event type that indicates that the root DisplayObject has been created.
An event type to be utilized in custom events. Not used by Starling right now.
Event type that is dispatched by the AssetManager when a file/url cannot be loaded.
An event type to be utilized in custom events. Not used by Starling right now.
Event type that is dispatched by the AssetManager after a context loss.
Event type for touch or mouse input.
Event type for a triggered button.
An event type to be utilized in custom events. Not used by Starling right now.
Returns a touch that originated over a certain target.
The object that was touched; may also be a parent of the actual touch-target.
The phase the touch must be in, or null if you don't care.
The ID of the requested touch, or -1 if you don't care.
Returns a list of touches that originated over a certain target. If you pass an
out
-vector, the touches will be added to this vector instead of creating
a new object.
Indicates if a target is currently being touched or hovered over.
Prevents any other listeners from receiving the event.
Prevents listeners at the next bubble stage from receiving the event.
Returns a description of the event, containing type and bubble information.
Generated using TypeDoc
A TouchEvent is triggered either by touch or mouse input.
In Starling, both touch events and mouse events are handled through the same class: TouchEvent. To process user input from a touch screen or the mouse, you have to register an event listener for events of the type
TouchEvent.TOUCH
. This is the only event type you need to handle; the long list of mouse event types as they are used in conventional Flash are mapped to so-called "TouchPhases" instead.The difference between mouse input and touch input is that
Which objects receive touch events?
In Starling, any display object receives touch events, as long as the
touchable
property of the object and its parents is enabled. There is no "InteractiveObject" class in Starling.How to work with individual touches
The event contains a list of all touches that are currently present. Each individual touch is stored in an object of type "Touch". Since you are normally only interested in the touches that occurred on top of certain objects, you can query the event for touches with a specific target:
touches:Vector.<Touch> = touchEvent.getTouches(this);
This will return all touches of "this" or one of its children. When you are not using multitouch, you can also access the touch object directly, like this:
touch:Touch = touchEvent.getTouch(this);
@see Touch @see TouchPhase