废话不说下面是代码
<s:Label x="10" y="10" text="我是那年出生的?? "/>
<s:RadioButton id="rb1" x="25" y="48" label="90"/>
<s:RadioButton id="rb3" x="107" y="43" height="23" label="92"/>
<s:RadioButton id="rb2" x="66" y="48" label="91"/>
<s:Button x="25" y="74" label="确定" click="button2_clickHandler(event)"/>
<s:VGroup x="272" y="27" click="ice()">
<s:RadioButton id="rbg1" label="按钮 1" groupName="radiogroup2"/>
<s:RadioButton id="rbg2" label="按钮 2" groupName="radiogroup2"/>
</s:VGroup>
<fx:Script>
<![CDATA[
import mx.controls.*;
import mx.controls.Alert;
import mx.events.*;
var mym:Menu;
protected function button2_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
Alert.show(rb1.selected?'正确':'错误'); 一个小判断语句 相信大家都知道
}
function ice():void
{
if (rbg1.selected)
{
Alert.show("按钮1");
}
else
{
Alert.show("按钮2");
}
}
]]>
</fx:Script>