Changes a target's state based on pointer events (
TouchEvent), like a button.
The current state of the utility. May be different than the state of the target.
The value for the "down" state.
May be set to
false to disable the state changes temporarily until set
The value for the "hover" state.
true, the current state will remain as
MouseEvent.MOUSE_UP is dispatched. If
false, and the pointer leaves
the bounds of the target after
MouseEvent.MOUSE_DOWN, the current
state will change to
IStateContext that may be used instead of
The target component that should change state based on pointer (mouse or touch) events.
The value for the "up" state.
callback:T ‑> Void
The function to call when the state is changed.
The callback is expected to have the following signature:
String -> Void
customHitTest:(stageX:Float, stageY:Float) ‑> Bool
In addition to the normal hit testing for mouse/touch events, a custom function may impose additional rules that determine if the target should change state.
The function should return
true if the target should change state, and
false if it should not change state.