Package | com.ghostwire.ui.controls |
Class | public class uiRadioButton |
Inheritance | uiRadioButton ![]() ![]() ![]() ![]() ![]() |
uiRadioButton
component sets its selected
property to true
when it is clicked. This control is used when you want the user to choose from a list of options that
are mutually exclusive. However, a uiRadioButton
instance behaves exactly just like a
uiCheckBox
does unless it belongs to a uiButtonGroup
.
This class exists for the sake of completion - it would be the same if you instantiate a
uiCheckBox
and set its skin to "RadioButton" (this is all this class does).
"group" Property
In order for a uiRadioButton
to work as intended, you must set its group
property to an existing uiButtonGroup
object (or specify the uiRadioButton
instance when creating the uiButtonGroup
instance).
// create the uiRadioButton instances var rb1:uiRadioButton = new uiRadioButton("choice 1"); var rb2:uiRadioButton = new uiRadioButton("choice 2"); var rb3:uiRadioButton = new uiRadioButton("choice 3"); // register the uiRadioButton instances to a uiButtonGroup instance var rbGroup:uiButtonGroup = new uiButtonGroup(rb1,rb2,rb3); // make choice 2 the initial choice rbGroup.selectedButton = rb2; // add the uiRadioButton instances to a uiBox layout container var rbList:uiBox = new uiBox(); rbList.addChild(rb1); rbList.addChild(rb2); rbList.addChild(rb3);
Only the currently selected member will be included in the tab focus chain. If that member has focus, the arrow keys can be used to select the next/previous member in the group. If none of the members are selected, the first member in the group will be included in the tab focus chain.
"skin" Property
The default value is "RadioButton"
and the asset(s) used are:
RadioButton.png
~ This class is available in Aspire UI Components Lite Edition ~
See also
Method | Defined by | ||
---|---|---|---|
uiRadioButton(text:String = null, image:String = null, textPosition:int = 0, labelPosition:int = 0)
Constructor - creates a new
uiRadioButton instance. | uiRadioButton | ||
![]() |
activate(noEvent:Boolean = false):void
Activates and gives focus to the button as if the button has been clicked on (a
MouseEvent.CLICK event will be dispatched). | uiButton | |
![]() |
invalidate(type:String):void
Invalidates this component's "size", "display", "layout" or "textstyle".
| uiComponent | |
![]() |
move(x:Number, y:Number, noEvent:Boolean = false):void
Moves the component to the specified position, disregarding its allocation.
| uiComponent | |
![]() |
removeAllChildren(all:Boolean = false):void
Removes all children from this component.
| uiComponent | |
![]() |
setFocus(flag:Boolean = true):void
Gives this component instance the focus; the component must be on the display list and has its
tabEnabled property set to true , otherwise this method will fail
silently. | uiComponent | |
![]() |
setSize(width:Number, height:Number, noEvent:Boolean = false):void
Sets this component's size to the specified
width and height . | uiComponent | |
![]() |
setVisible(value:Boolean, noEvent:Boolean = false):void
Sets the visibility of this component instance, dispatching a "show" or "hide" event accordingly.
| uiComponent | |
![]() |
validateNow():void
Validates and render the component instance, and any component instances with
depth higher than itself in the validation queue, immediately. | uiComponent |
uiRadioButton | () | constructor |
public function uiRadioButton(text:String = null, image:String = null, textPosition:int = 0, labelPosition:int = 0)
Constructor - creates a new uiRadioButton
instance.
text:String (default = null ) — A String value specifying the text to display next to the radiobutton.
|
|
image:String (default = null ) — A String value indicating the source to the image/icon to be displayed next to the
radiobutton.
|
|
textPosition:int (default = 0 ) — A String value indicating the position of the uiText
instance vis-a-vis the uiImage instance, if any. Qualified values are
POSITION.LEFT , POSITION.RIGHT , POSITION.TOP or
POSITION.BOTTOM . By default, the uiText is placed to the right
of the uiImage .
|
|
labelPosition:int (default = 0 ) — A String value indicating the position of the label (text/icon) vis-a-vis
the radiobutton. Qualified values are POSITION.LEFT , POSITION.RIGHT ,
POSITION.TOP or POSITION.BOTTOM . By default, the label is positioned
to the right of the radiobutton.
|