반응형
FormTest.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Panel width="400" height="380" layout="absolute" horizontalCenter="0" verticalCenter="0" title="form test">
<mx:Form width="380" height="304">
<mx:FormItem label=" name">
<mx:TextInput width="274" id="ti"/>
</mx:FormItem>
<mx:FormItem label="sex" direction="horizontal" width="336" id="sex">
<mx:RadioButtonGroup id="rg1"/>
<mx:RadioButton label="male" groupName="rg1"/>
<mx:RadioButton label="female" groupName="rg1"/>
</mx:FormItem>
<mx:RichTextEditor title="Title" height="209" width="339" id="rte">
</mx:RichTextEditor>
</mx:Form>
<mx:ControlBar horizontalAlign="center">
<mx:Button label="submit" click="show()"/>
</mx:ControlBar>
</mx:Panel>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
function show():void{
mx.controls.Alert.show("name: "+ti.text+"\n"+"sex: "+rg1.selectedValue+"\n"+"memo: "+rte.text);
}
]]>
</mx:Script>
</mx:Application>
반응형