Allows a component to claim exclusive access to a pointer (a touch point or the mouse cursor) to avoid dragging conflicts, scrolling conflicts, or other 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 a pointer. Multiple objects being controlled by the same pointer often results in unexpected behavior for user experience.

Available since

1.0.0

.

Static variables

@:value(-1000)staticfinalread onlyPOINTER_ID_MOUSE:Int = -1000

Deprecated: "ExclusivePointer.POINTER_ID_MOUSE is deprecated. There are now separate APIs for touch and mouse."

A special pointer ID for the mouse.

Available since

1.0.0

.

Static methods

staticdisposeForStage(stage:Stage):Void

Disposes the exclusive pointer manager for the specified stage.

Available since

1.0.0

.

staticforStage(stage:Stage):ExclusivePointer

Retrieves the exclusive pointer manager for the specified stage (creating one if it does not yet exist).

Available since

1.0.0

.

Methods

claimMouse(target:DisplayObject):Bool

Allows a display object to claim the mouse. Returns true if if the mouse is claimed. Returns false if the mouse was previously claimed by another display object.

See also:

claimPointer(pointerID:Int, target:DisplayObject):Bool

Deprecated: "ExclusivePointer.claimPointer() is deprecated. Use ExclusivePointer.claimTouch() and ExclusivePointer.claimMouse() instead."

claimTouch(touchPointID:Int, target:DisplayObject):Bool

Allows a display object to claim a touch by its ID. Returns true if if the touch is claimed. Returns false if the touch was previously claimed by another display object.

Available since

1.0.0

.

getClaim(pointerID:Int):DisplayObject

Deprecated: "ExclusivePointer.getClaim() is deprecated. Use ExclusivePointer.getTouchClaim() and ExclusivePointer.getMouseClaim() instead."

getMouseClaim():DisplayObject

Gets the display object that has claimed the mouse. If no display object claims the mouse, returns null.

Available since

1.0.0

.

getTouchClaim(touchPointID:Int):DisplayObject

Gets the display object that has claimed a touch with the specified ID. If no display object claims the touch with the specified ID, returns null.

Available since

1.0.0

.

hasClaim():Bool

Indicates if there is at least one claim to mouse or touch.

Available since

1.0.0

.

removeAllClaims():Void

Removes all claims to mouse or touch.

Available since

1.0.0

.

removeClaim(pointerID:Int):Void

Deprecated: "ExclusivePointer.removeClaim() is deprecated. Use ExclusivePointer.removeTouchClaim() and ExclusivePointer.removeMouseClaim() instead."

removeMouseClaim():Void

Removes a claim to the mouse.

Available since

1.0.0

.

removeTouchClaim(touchPointID:Int):Void

Removes a claim to the touch with the specified ID.

Available since

1.0.0

.