建立Helloworld.mxml文件
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" backgroundColor="white" creationComplete="init();"> <mx:Script> <![CDATA[ import mx.controls.Alert; function helloWorld():void{ Alert.show("Who is sb?"+"\n "+h.text); } ]]> </mx:Script> <mx:TextInput x="148" y="167" id="h" text="Jonathan"/> <mx:Button label="Who is sb?" width="146" id="Hello_btn" horizontalCenter="-129" click="helloWorld();"/> </mx:Application>
然后使用Adobe Flex Builder 3自带的Adobe Flex 3 SDK Command Prompt运行:
mxmlc Helloworld.mxml
生成出Helloworld.swf
然后用浏览器或者flash播放器运行。