2. 这篇文章,如何搭建环境: http://help.adobe.com/en_US/air/build/WS2d8d13466044a7337d7adee012406959c52-8000.html#WS2d8d13466044a73328ed2239124110d12b3-8000
基本上,对于AIR, 先下载ZIP包(FLEX-SDK-4.5.1.zip) ,然后解压缩,然后把bin 路径添加到PATH 系统变量中。
3. 先把台阶弄低点,从HTML 入手(见这个文章: Creating your first HTML-based AIR application with the AIR SDK http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7ecc.html )
Create the project files
Create the AIR application descriptor file
Create the application HTML page
Test the application
Create the AIR installation file
Next Steps
For a quick, hands-on illustration of how Adobe® AIR® works, use these instructions to create and package a simple HTML-based AIR “Hello World” application.
To begin, you must have installed the runtime and set up the AIR SDK. You will use the AIR Debug Launcher (ADL) and the AIR Developer Tool (ADT) in this tutorial. ADL and ADT are command-line utility programs and can be found in the bin directory of the AIR SDK (see Installing the AIR SDK). This tutorial assumes that you are already familiar with running programs from the command line and know how to set up the necessary path environment variables for your operating system.
Note: If you are an Adobe® Dreamweaver® user, read Create your first HTML-based AIR application with Dreamweaver.
Note: HTML-based AIR applications can only be developed for the desktop and the extendedDesktop profiles. The mobile and tv profiles are not supported.
Create the project files
Every HTML-based AIR project must contain the following two files: an application descriptor file, which specifies the application metadata, and a top-level HTML page. In addition to these required files, this project includes a JavaScript code file, AIRAliases.js, that defines convenient alias variables for the AIR API classes.
Create a directory named HelloWorld to contain the project files.
Create an XML file, named HelloWorld-app.xml.
Create an HTML file named HelloWorld.html.
Copy AIRAliases.js from the frameworks folder of the AIR SDK to the project directory.
这个文件应该是在这里: D:\flex_sdk_4.5.1\frameworks\libs\air
说的不太清楚。意思是:
1. 首先,建立个文件夹,名字随便取。
2. 在这个 新文件夹中,建立几个文件。
$ls
AIRAliases.js hello_bird.html hellow_bird-app.xml
3. 比较关键的 项目描述文件的内容:
12 examples.html.HelloWorld 30.1 4hello_bird 56 11hello_bird.html 7true 8400 9200 10
注意: xmlns="http://ns.adobe.com/air/application/2.7" 是行不通的。会出现错误: invalid application descriptor: Unknown namespace: http://ns.adobe.com/air/application/2.7
把2.7 改成 2.6 就好了。(参考: http://forums.adobe.com/thread/879313 )
4. 然后,对应的HTML 文件(hello_bird.html) 的内容为:
1 2 3 4 9Hello World 10 11 12Hello World in HTML file! !!!
13 14
5. 编译,运行:
cd
adl hellow_bird-app.xml
可以看到console和HTML的内容都显示了出来。 还是挺爽的。
至此,还是感觉不错的。起码看到了效果。
但是下一步进行不下去了:
$ adt -package -storetype pkcs12 -keystore sampleCert.pfx HellowBird.air hello_bird.html hellow_bird-app.xml AIRAliases.js
password:
D:\workspace\bird_bird\hello_bird\hello_bird.html: error 101: Namespace is missing
太郁闷了。 这个Namespace 搞不定啊。没任何资料。 官方给的2个: 2.7, 3.0 都不行。莫非是我在公司防火墙? 但是 2.0, 2.6 都可以用啊。
算了, 先放着。 反正上午开始的 1G 的flash builder 5已经下载好了。 走走action script的路子吧。