Package | feathers.events |
Class | public class ExclusiveTouch |
Inheritance | ExclusiveTouch ![]() ![]() |
Product Version : | Feathers 1.2.0 |
Due to the way that Starling's touch behavior is implemented, when objects are nested, the inner object will always have precedence. However, from a usability perspective, this is generally the expected behavior, so this restriction isn't expected to cause any issues.
Method | Defined By | ||
---|---|---|---|
ExclusiveTouch(stage:Stage)
Constructor. | ExclusiveTouch | ||
![]() | addEventListener(type:String, listener:Function):void Registers an event listener at a certain object. | EventDispatcher | |
claimTouch(touchID:int, target:DisplayObject):Boolean
Allows a display object to claim a touch by its ID. | ExclusiveTouch | ||
![]() | dispatchEvent(event:Event):void Dispatches an event to all objects that have registered listeners for its type. | EventDispatcher | |
![]() | dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void Dispatches an event with the given parameters to all objects that have registered
listeners for the given type. | EventDispatcher | |
disposeForStage(stage:Stage):void [static]
Disposes the exclusive touch manager for the specified stage. | ExclusiveTouch | ||
[static]
Retrieves the exclusive touch manager for the specified stage. | ExclusiveTouch | ||
getClaim(touchID:int):DisplayObject
Gets the display object that has claimed a touch with the specified
ID. | ExclusiveTouch | ||
![]() | hasEventListener(type:String, listener:Function = null):Boolean If called with one argument, figures out if there are any listeners registered for
the given event type. | EventDispatcher | |
removeClaim(touchID:int):void
Removes a claim to the touch with the specified ID. | ExclusiveTouch | ||
![]() | removeEventListener(type:String, listener:Function):void Removes an event listener from the object. | EventDispatcher | |
![]() | removeEventListeners(type:String = null):void Removes all event listeners with a certain type, or all of them if type is null. | EventDispatcher |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when a touch ID is claimed or a claim is removed. | ExclusiveTouch |
ExclusiveTouch | () | Constructor |
claimTouch | () | method |
public function claimTouch(touchID:int, target:DisplayObject):Boolean
Allows a display object to claim a touch by its ID. Returns
true
if the touch is claimed. Returns false
if the touch was previously claimed by another display object.
Parameters
touchID:int | |
target:DisplayObject |
Boolean |
disposeForStage | () | method |
public static function disposeForStage(stage:Stage):void
Disposes the exclusive touch manager for the specified stage.
Parameters
stage:Stage |
forStage | () | method |
public static function forStage(stage:Stage):ExclusiveTouch
Retrieves the exclusive touch manager for the specified stage.
Parameters
stage:Stage |
ExclusiveTouch |
getClaim | () | method |
public function getClaim(touchID:int):DisplayObject
Gets the display object that has claimed a touch with the specified
ID. If no touch claims the touch with the specified ID, returns
null
.
Parameters
touchID:int |
DisplayObject |
removeClaim | () | method |
public function removeClaim(touchID:int):void
Removes a claim to the touch with the specified ID.
Parameters
touchID:int |
change | Event |
starling.events.Event
starling.events.Event.CHANGE
Dispatched when a touch ID is claimed or a claim is removed. The
data
property is the touch ID.