State Model for buttons. This model is used for check boxes and radio buttons, which are special kinds of buttons, as well as for normal buttons. For check boxes and radio buttons, pressing the mouse selects the button.
In use, a UI will invoke setSelected when a mouse click occurs over a check box or radio button.
public function addChangeListener(func:Function, obj:Object):Object
Add a listener to listen the Model's change event.
When the button's state changed, the state is all about:
the listener added.
public function addSelectionListener(func:Function, obj:Object):Object
Add a listener to listen the Model's selection change event.
When the button's selection changed, fired when diselected or selected.
onSelectionChanged Event{source:ButtonModel}
the listener added.
public function isEnabled():Boolean
Indicates if the button can be selected or pressed by an input device (such as a mouse pointer).
public function isPressed():Boolean
Indicates that the button has been pressed the and not be released yet.
This is not same as Java Swing's, this is some like Java Swing's Armed
public function isReleased():Boolean
Indicates if button has been released. This is some like java Swing's pressed when released inside.
public function setGroup(group:ButtonGroup):Void
Identifies the group this button belongs to -- needed for radio buttons, which are mutually exclusive within their group.
group | the ButtonGroup this button belongs to |