(Preview)
Package | spark.components |
Class | public class RadioButtonGroup |
Inheritance | RadioButtonGroup ![]() ![]() |
Implements | IMXMLObject |
Language Version: | ActionScript 3.0 |
Product Version: | Flex 4 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
id
property is required when you use the
<s:RadioButtonGroup>
tag to define the group name. Any
<s:RadioButton>
component added to this group will
have this group name.
Notice that the RadioButtonGroup component is a subclass of EventDispatcher,
not UIComponent, and implements the IMXMLObject interface.
All other Flex visual components implement the IVisualElement interface.
The RadioButtonGroup component declaration must
be contained within the <Declarations>
tag since it is
not assignable to IVisualElement.
To use this component in a list-based component, such as a List or DataGrid, create an item renderer. For information about creating an item renderer, see Custom Spark item renderers.
MXML Syntax
The <s:RadioButtonGroup>
tag inherits all of the
tag attributes of its superclass, and adds the following tag attributes:
<s:RadioButtonGroup Properties enabled="true" selectedValue="null" selection="null" Events change="No default" itemClick="No default" valueCommit="No default" />
More examples
Related API Elements
Public Properties
Property | Defined By | ||
---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance. | Object |
Public Methods
Method | Defined By | ||
---|---|---|---|
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | EventDispatcher | |
![]() |
Dispatches an event into the event flow. | EventDispatcher | |
![]() |
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | EventDispatcher | |
![]() |
Indicates whether an object has a specified property defined. | Object | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | |
![]() |
Indicates whether the specified property exists and is enumerable. | Object | |
![]() |
Removes a listener from the EventDispatcher object. | EventDispatcher | |
![]() |
Sets the availability of a dynamic property for loop operations. | Object | |
![]() |
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | |
![]() |
Returns the string representation of the specified object. | Object | |
![]() |
Returns the primitive value of the specified object. | Object | |
![]() |
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type. | EventDispatcher |
Events
Event | Summary | Defined By | ||
---|---|---|---|---|
![]() | [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | ||
![]() | [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher |
Property Detail
Constructor Detail
Method Detail
Event Detail
Examples How to use this example
RadioButtonGroupExample.mxml
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <fx:Script> <![CDATA[ import mx.controls.Alert; import mx.events.ItemClickEvent; private function handlePayment(event:ItemClickEvent):void { if (event.currentTarget.selectedValue == "check") { Alert.show("You opted to pay by check."); } else if (event.currentTarget.selectedValue == "credit") { Alert.show("You opted to pay by credit card."); } } ]]> </fx:Script> <fx:Declarations> <s:RadioButtonGroup id="paymentType" itemClick="handlePayment(event);"/> </fx:Declarations> <s:VGroup paddingLeft="10" paddingTop="10"> <s:RadioButton groupName="paymentType" id="payCheck" value="check" label="Pay by check" width="150"/> <s:RadioButton groupName="paymentType" id="payCredit" value="credit" label="Pay by credit card" width="150"/> </s:VGroup> </s:Application>
Wed Nov 21 2018, 06:34 AM -08:00