class BasicButton
package feathers.controls
extends FeathersControl › MeasureSprite › ValidatingSprite
implements IStateContext<ButtonState>, ITriggerView
extended by Button
A simple button control with states, but no content, that is useful for
purposes like skinning. For a more full-featured button, with a label and
icon, see feathers.controls.Button
instead.
Events:
feathers.events.FeathersEvent.STATE_CHANGE | Dispatched when
|
---|---|
feathers.events.TriggerEvent.TRIGGER | Dispatched when the the user taps or clicks the button. The pointer must remain within the bounds of the button on release to register as a tap or a click. If focus management is enabled, the button may also be triggered by pressing the spacebar while the button has focus. |
1.0.0
.See also:
Constructor
Variables
backgroundSkin:DisplayObject
The display object to use as the background skin for the button.
To render a different background skin, depending on the button's current
state, pass additional skins to setSkinForState()
.
The following example passes a bitmap for the button to use as a background skin:
button.backgroundSkin = new Bitmap(bitmapData);
1.0.0
.See also:
read onlycurrentState:ButtonState
The current state of the button.
When the value of the currentState
property changes, the button will
dispatch an event of type FeathersEvent.STATE_CHANGE
.
1.0.0
.See also:
keepDownStateOnRollOut:Bool
Determines if a pressed button should remain in the down state if the
pointer moves outside of the button's bounds. Useful for controls like
HSlider
, VSlider
, or ToggleSwitch
to keep a thumb in the down
state while it is being dragged around by the pointer.
The following example ensures that the button's down state remains active on roll out.
button.keepDownStateOnRollOut = true;
1.0.0
.Methods
getSkinForState(state:ButtonState):DisplayObject
Gets the skin to be used by the button when its currentState
property
matches the specified state value.
If a skin is not defined for a specific state, returns null
.
1.0.0
.See also:
setSkinForState(state:ButtonState, skin:DisplayObject):Void
Set the skin to be used by the button when its currentState
property
matches the specified state value.
If a skin is not defined for a specific state, the value of the
backgroundSkin
property will be used instead.
1.0.0
.See also: