Flex之Hello World

一,到sun网站下载并安装jdk-6-windows-i586.exe并安装
安装完将%JAVA_HOME%\bin加入你的系统path环境变量中去

二,到adobe网站下载flex_sdk_2.zip
解压,然后将%FLEX_HOME%\bin加入path

三,运行%FLEX_HOME%\samples\build-samples.bat
然后可以用%FLEX_HOME%\player\debug\下的FlashPlayer或者IE来参看%FLEX_HOME%\samples\下的几个demo,其中explorer下面的explorer.swf是各个component的示例和MXML代码

四,在任意目录下建立hello.mxml
[code]
<?xml version="1.0"?>
<!-- Simple example to demonstrate the Alert control. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:Script>
<![CDATA[
import mx.controls.Alert;
]]>
</mx:Script>

<mx:Panel title="Hello, flex!" width="100%" horizontalAlign="center">
<mx:Button label="Click Me" click="Alert.show('Hello flex, I am coming!', 'Hello, flex!');"/>
</mx:Panel>

</mx:Application>
[/code]
然后cmd切换到当前目录并运行
[code]
mxmlc hello.mxml
[/code]
当前目录就生成了你的hello.swf文件
你可以用FlashPlayer来查看它,也可以写一个html来查看它,如hello.html
[code]
<body bgcolor="white">
<embed src="hello.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="120" menu="false" quality="high"></embed>
</body>
[/code]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值