Flex 4 ~ get RadioGroup selected value

這是取得RadioGroup數值的方法~


MXML
--------------------------------------------------------------------------------------------

<fx:Declarations>
<s:RadioButtonGroup id="gender" change="genderChangeHandler(event)"/>
</fx:Declarations>


<s:RadioButton x="394" y="441" label="男" groupName="gender"/>
<s:RadioButton x="433" y="441" label="女" groupName="gender"/>


--------------------------------------------------------------------------------------------


Action Script
--------------------------------------------------------------------------------------------
protected function genderChangeHandler(event:Event):void
{
Alert.show(gender.selectedValue.toString());
}

--------------------------------------------------------------------------------------------


reference
http://www.flashabc.net/post/Flex_RadioButton.html

沒有留言: