Packagefeathers.events
Classpublic class ExclusiveTouch
InheritanceExclusiveTouch Inheritance starling.events.EventDispatcher

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
  
ExclusiveTouch(stage:Stage)
Constructor.
ExclusiveTouch
  
claimTouch(touchID:int, target:DisplayObject):Boolean
Allows a display object to claim a touch by its ID.
ExclusiveTouch
  
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
  
removeClaim(touchID:int):void
Removes a claim to the touch with the specified ID.
ExclusiveTouch
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.