星期一

Build and Run Adobe AIR in Windows

1. Install Adobe Flex SDK

2. Create AIR certificate:
> adt -certificate -cn "AnyCertificateCommonName" 1024-RSA outCertFile.pfx password

3. Create a file winapp.mxml. (Notice the tag is "WindowedApplication")
---------- winapp.mxml ----------
<?xml version="1.0" encoding="utf-8"?>

<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:s="library://ns.adobe.com/flex/spark">
   <s:Label text="Hello World AIR" />
</s:WindowedApplication>
---------- winapp.mxml ----------

4. Copy file C:\flex_sdk_4.6\templates\air\descriptor-template.xml to current folder name as application.xml

5. Edit application.xml, change the following items:
<id>[A universally unique application identifier]</id>
<filename>winapp</filename>
<name>winapp</name>
<content>winapp.swf</content>

6. Compile winapp.mxml.
> amxmlc winapp.mxml

7. Build AIR application. (output: winapp.air)
> adt -package -storetype pkcs12 -keystore outCertFile.pfx winapp.air application.xml winapp.swf winapp.mxml
(You need the password of the certificate here)

8. Install AIR runtime at the compile. (the AIR application can only run at the computer installed AIR runtime) (http://get.adobe.com/tw/air/) (My version is 3.5, 16.5 MB)

9. Double click the winapp.air file. Done.

沒有留言: