Packagefeathers.events
Classpublic class ExclusiveTouch
InheritanceExclusiveTouch Inheritance EventDispatcher Inheritance Object

Product Version : Feathers 1.2.0

Allows a component to claim exclusive access to a touch to avoid dragging, scrolling, or other touch interaction conflicts. In particular, if objects are nested, and they can be scrolled or dragged, it's better for one to eventually gain exclusive control over the touch. Multiple objects being controlled by the same touch often results in unexpected behavior.

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.



Public Methods
 MethodDefined By
  
Constructor.
ExclusiveTouch
 Inherited
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
 Inherited
dispatchEvent(event:Event):void
Dispatches an event to all objects that have registered listeners for its type.
EventDispatcher
 Inherited
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
  
[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
 Inherited
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
 Inherited
removeEventListener(type:String, listener:Function):void
Removes an event listener from the object.
EventDispatcher
 Inherited
removeEventListeners(type:String = null):void
Removes all event listeners with a certain type, or all of them if type is null.
EventDispatcher
Events
 Event Summary Defined By
  Dispatched when a touch ID is claimed or a claim is removed.ExclusiveTouch
Constructor Detail
ExclusiveTouch()Constructor
public function ExclusiveTouch(stage:Stage)

Constructor.

Parameters
stage:Stage
Method Detail
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

Returns
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

Returns
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

Returns
DisplayObject
removeClaim()method 
public function removeClaim(touchID:int):void

Removes a claim to the touch with the specified ID.

Parameters

touchID:int

Event Detail
change Event
Event Object Type: starling.events.Event
Event.type property = starling.events.Event.CHANGE

Dispatched when a touch ID is claimed or a claim is removed. The data property is the touch ID.

An event type to be utilized in custom events. Not used by Starling right now.