| Package | qnx.ui.buttons |
| Class | public class RadioButtonGroup |
| Inheritance | RadioButtonGroup flash.events.EventDispatcher |
RadioButtonGroup class contains the functionality for handling a group of related radio buttons.
See also
| Property | Defined By | ||
|---|---|---|---|
| length : int [read-only]
Returns the number of buttons that have been added to the group. | RadioButtonGroup | ||
| name : String [read-only]
Returns the name of the group. | RadioButtonGroup | ||
| selection : RadioButton [read-only]
Returns the currently selected radio button. | RadioButtonGroup | ||
| Method | Defined By | ||
|---|---|---|---|
RadioButtonGroup(groupname:String)
Do not use this constructor. | RadioButtonGroup | ||
addButton(button:RadioButton):void
Adds a button of type RadioButton to the group. | RadioButtonGroup | ||
getGroup(name:String):RadioButtonGroup [static]
Returns a radio button group object given a unique name. | RadioButtonGroup | ||
getUniqueId():int [static]
Returns a unique ID to ensure radio group IDs are not duplicated. | RadioButtonGroup | ||
removeButton(button:RadioButton):void
Removes the specified button from the group (assuming the button exists). | RadioButtonGroup | ||
setSelectedRadioButton(button:RadioButton, throwEvent:Boolean = true):void
Sets the specified radio button to selected. | RadioButtonGroup | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when the selection property of the group changes. | RadioButtonGroup | |||
| length | property |
length:int [read-only] Returns the number of buttons that have been added to the group.
public function get length():int| name | property |
name:String [read-only] Returns the name of the group.
public function get name():String| selection | property |
selection:RadioButton [read-only] Returns the currently selected radio button.
public function get selection():RadioButtonSee also
| RadioButtonGroup | () | Constructor |
public function RadioButtonGroup(groupname:String)Do not use this constructor.
Instead, use the getGroup method to create a RadioButtonGroup instance.
groupname:String |
See also
| addButton | () | method |
public function addButton(button:RadioButton):void
Adds a button of type RadioButton to the group.
Note that in order to add a button to a group, you must also set the groupname property of each button to the name of the
RadioGroupName.
Parameters
button:RadioButton — The button to add to the group. Must be of type RadioButton.
|
See also
| getGroup | () | method |
public static function getGroup(name:String):RadioButtonGroup
Returns a radio button group object given a unique name.
Use this method in order to create a new RadioButtonGroup instance.
In the following listing, a RadioButtonGroup is instantiated and given the unique name
rbg1_meals13.
var rbg1:RadioButtonGroup;
rbg1 = RadioButtonGroup.getGroup( "rbg1_meals13" );
rbg1.addButton( rb1 );
rbg1.addButton( rb2 );
rbg1.addButton( rb3 );
rbg1.addEventListener( MouseEvent.CLICK, rbg1Change );
rbg1.setSelectedRadioButton( rb2 );
Parameters
name:String — The name of the group.
|
RadioButtonGroup — RadioButtonGroup
|
| getUniqueId | () | method |
public static function getUniqueId():intReturns a unique ID to ensure radio group IDs are not duplicated.
Returnsint — A unique int.
|
| removeButton | () | method |
public function removeButton(button:RadioButton):voidRemoves the specified button from the group (assuming the button exists).
Parameters
button:RadioButton — The RadioButton to remove from the group.
|
See also
| setSelectedRadioButton | () | method |
public function setSelectedRadioButton(button:RadioButton, throwEvent:Boolean = true):voidSets the specified radio button to selected.
Parameters
button:RadioButton — The button to set to selected. Must be of type RadioButton.
| |
throwEvent:Boolean (default = true) |
See also
| change | Event |
flash.events.Eventflash.events.Event.CHANGE
Dispatched when the selection property of the group changes.