Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 9, AIR 1.1 |
The RadioButtonGroup control defines a group of RadioButton controls
that act as a single mutually exclusive control; therefore,
a user can select only one RadioButton control at a time. While grouping
RadioButton instances
in a RadioButtonGroup is optional, a group lets you do things
like set a single event handler on a group of buttons, rather than
on each individual button.
The id
property is required when you use the
<mx:RadioButtonGroup>
tag to define the name
of the group.
Notice that the RadioButtonGroup control is a subclass of EventDispatcher, not UIComponent,
and implements the IMXMLObject interface.
All other Flex visual components are subclasses of UIComponent, which implements
the IUIComponent interface.
The RadioButtonGroup control has support built into the Flex compiler
that allows you to use the RadioButtonGroup control as a child of a Flex container,
even though it does not implement IUIComponent.
All other container children must implement the IUIComponent interface.
Therefore, if you try to define a visual component as a subclass of
EventDispatcher that implements the IMXMLObject interface,
you will not be able to use it as the child of a container.
Show MXML Syntax
Hide MXML Syntax The <mx:RadioButtonGroup>
tag inherits all of the
tag attributes of its superclass, and adds the following tag attributes:
<mx:RadioButtonGroup
Properties
enabled="true|false"
id="No default"
labelPlacement="right|left|top|bottom"
Events
change="No default"
itemClick="No default"
/>
enabled:Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 9, AIR 1.1 |
Determines whether selection is allowed.
The default value is true
.
This property can be used as the source for data binding.
Implementation public function get enabled():Boolean
public function set enabled(value:Boolean):void
labelPlacement:String
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 9, AIR 1.1 |
Position of the RadioButton label relative to the RadioButton icon
for each control in the group.
You can override this setting for the individual controls.
Valid values in MXML are "right"
, "left"
,
"bottom"
, and "top"
.
In ActionScript, you use the following constants to set this property:
ButtonLabelPlacement.RIGHT
, ButtonLabelPlacement.LEFT
,
ButtonLabelPlacement.BOTTOM
, and ButtonLabelPlacement.TOP
.
The default value is "right"
.
This property can be used as the source for data binding.
Implementation public function get labelPlacement():String
public function set labelPlacement(value:String):void
numRadioButtons:int
[read-only]
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 9, AIR 1.1 |
The number of RadioButtons that belong to this RadioButtonGroup.
The default value is "undefined"
.
This property can be used as the source for data binding.
Implementation public function get numRadioButtons():int
selectedValue:Object
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 9, AIR 1.1 |
The value of the value
property of the selected
RadioButton control in the group, if this has been set
to be something other than null
(the default value).
Otherwise, selectedValue
is the value of the
label
property of the selected RadioButton.
If no RadioButton is selected, this property is null
.
If you set selectedValue
, Flex selects the
RadioButton control whose value
or
label
property matches this value.
The default value is null
.
This property can be used as the source for data binding.
Implementation public function get selectedValue():Object
public function set selectedValue(value:Object):void
selection:RadioButton
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 9, AIR 1.1 |
Contains a reference to the currently selected
RadioButton control in the group.
You can access the property in ActionScript only;
it is not settable in MXML.
Setting this property to null
deselects the currently selected RadioButton control.
The default value is null
.
This property can be used as the source for data binding.
Implementation public function get selection():RadioButton
public function set selection(value:RadioButton):void
public function RadioButtonGroup(document:IFlexDisplayObject = null)
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 9, AIR 1.1 |
Constructor.
Parameters | document:IFlexDisplayObject (default = null ) — In simple cases where a class extends EventDispatcher,
the document parameter should not be used.
|
See also
flash.events.EventDispatcher
public function getRadioButtonAt(index:int):RadioButton
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 9, AIR 1.1 |
Returns the RadioButton control at the specified index.
Parameters
| index:int — The index of the RadioButton control in the
RadioButtonGroup control, where the index of the first control is 0.
|
Returns public function initialized(document:Object, id:String):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 9, AIR 1.1 |
Implementation of the IMXMLObject.initialized()
method
to support deferred instantiation.
Parameters
| document:Object — The MXML document that created this object.
|
|
| id:String — The identifier used by document to refer to this object.
If the object is a deep property on document, id is null.
|
See also
Event Object Type: flash.events.Event
Event.type property = flash.events.Event.CHANGE
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 9, AIR 1.1 |
Dispatched when the value of the selected RadioButton control in
this group changes.
Event Object Type: mx.events.ItemClickEvent
ItemClickEvent.type property = mx.events.ItemClickEvent.ITEM_CLICK
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 9, AIR 1.1 |
Dispatched when a user selects a RadioButton control in the group.
You can also set a handler for individual RadioButton controls.
The
ItemClickEvent.ITEM_CLICK
constant defines the value of the
type
property of the event object for an
itemClick
event.
The properties of the event object have the following values:
Property | Value |
---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
index | The index of the navigation item that was clicked. |
item | The item in the data provider of the navigation
item that was clicked. |
label | The label of the navigation item that was clicked. |
relatedObject | The child object that generated the event. |
target | The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event. |
Mon Feb 18 2013, 01:33 PM +11:00