Flash Builder 4中构建纯as的AIR项目

下面介绍个使用Flash Builder 4构建纯ActionScript书写AIR项目的窍门。
1. 文件 > 新建 > “Flex Project”
2. 填项目名: “Foo”
3. 选择 “Desktop (runs in Adobe AIR)”
4. 按 “Finish”
5. 删除 “Foo.mxml”
6. 文件 > 新建 > ActionScript类命名为”Foo”,并使用”flash.display.Sprite”作为超类
7. 按Finish.
8. 右击”Foo.as”并选择”Set as Default Application”
9. 在Foo.as的构造函数中,写下”this.stage.nativeWindow.visible = true;”
10. 完成!

下面是Flash Builder 4写的例子”Foo”,下载

假设你所使用的名字和生成的MXML名字一致,那你的项目可以100%的运行,debug,profile。MXMLC编译器,MXML文件在被编译之前直接被翻译成ActionScript类。所以名字一致了就可以互换。

为什么AIR项目中要单使用ActionScript类?移动设备。
AIR应用已经能移动设备上工作了。

Cheers,

posted on 2010-10-17 16:28  riacool  阅读(1409)  评论(1编辑  收藏  举报

导航