Changes a target's state based on pointer events (
TouchEvent), like a button.
new (?target:InteractiveObject, ?callback:String ‑> Void)
read onlycurrentState:String = ButtonState.UP
The current state of the utility. May be different than the state of the target.
downState:String = ButtonState.DOWN
The value for the "down" state.
enabled:Bool = true
May be set to
false to disable the state changes temporarily until set
hoverState:String = ButtonState.HOVER
The value for the "hover" state.
keepDownStateOnRollOut:Bool = false
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
target:InteractiveObject = null
The target component that should change state based on pointer (mouse or touch) events.
upState:String = ButtonState.UP
The value for the "up" state.
callback:String ‑> Void = null
The function to call when the state is changed.
The callback is expected to have the following signature:
String -> Void