Overview
Stephen Gray has a post about getting selected RadioButton value in Flex. It points out the use of RadioButtonGroup.
Reference
Flex getting selected RadioButton value
Steps
Source from Stephen Gray’s blog post:
- Create a “RadioButtonGroup” MXML tag and give a id to it.
- Assign the RadioButtons’ “groupName” attribute to point to the RadioButtonGroup at step 1 (remember to use “{}”)
<mx:RadioButtonGroup id="myRadioButtonGroup" enabled="true" />
<mx:RadioButton label="I like RadioButtons" groupName="{myRadioButtonGroup}" left="505" top="64" selected="true" value="true"/>
<mx:RadioButton label="I don't like RadioButtons" groupName="{myRadioButtonGroup}" left="348" top="62" value="false"/>
- Access the selected value by the RadioButtonGroup
Alert.show(myRadioButtonGroup.selectedValue.toString());
沒有留言:
發佈留言