Changes a target's state based on keyboard events, like a button.

Available since

1.0.0

.

See also:

Constructor

@:value({ callback : null, target : null })new(?target:InteractiveObject, ?callback:T ‑> Void, upState:T, downState:T)

Creates a new KeyToState object with the given arguments.

Available since

1.0.0

.

Variables

@:flash.propertyread onlycurrentState:T

The current state of the utility. May be different than the state of the target.

Available since

1.0.0

.

@:flash.propertydownState:T

The value for the "down" state.

Available since

1.0.0

.

@:flash.propertyenabled:Bool

May be set to false to disable the state changes temporarily until set back to true.

Available since

1.0.0

.

@:flash.propertytarget:InteractiveObject

The target component that should change state based on pointer (mouse or touch) events.

Available since

1.0.0

.

@:flash.propertyupState:T

The value for the "up" state.

Available since

1.0.0

.

@:flash.propertycallback:T ‑> Void

The function to call when the state is changed.

The callback is expected to have the following signature:

String -> Void
Available since

1.0.0

.