属性
minimumPatchLevel — 此应用程序必需的 AIR 运行时最低修补级别。
xmlns — XML 命名空间属性决定应用程序所需的 AIR 运行时版本。
该命名空间因每个 AIR 主版本而异(但不会因次要修补程序而异)。命名空间的最后一段(如“3.0,”)指示应用程序所需的运行时版本。
针对 AIR 版本的 xmlns 值为:
xmlns="http://ns.adobe.com/air/application/1.0"
xmlns="http://ns.adobe.com/air/application/1.1"
xmlns="http://ns.adobe.com/air/application/1.5"
xmlns="http://ns.adobe.com/air/application/1.5.2"
xmlns="http://ns.adobe.com/air/application/1.5.3"
xmlns="http://ns.adobe.com/air/application/2.0"
xmlns="http://ns.adobe.com/air/application/2.5"
xmlns="http://ns.adobe.com/air/application/2.6"
xmlns="http://ns.adobe.com/air/application/2.7"
xmlns="http://ns.adobe.com/air/application/3.0"
xmlns="http://ns.adobe.com/air/application/3.1"
xmlns="http://ns.adobe.com/air/application/3.2"
xmlns="http://ns.adobe.com/air/application/3,3"
xmlns="http://ns.adobe.com/air/application/3.4"
xmlns="http://ns.adobe.com/air/application/3.5"
xmlns="http://ns.adobe.com/air/application/3.6"
xmlns="http://ns.adobe.com/air/application/3.7"
对基于 SWF 的应用程序,应用程序描述符中指定的 AIR 运行时版本决定了可以作为应用程序初始内容加载的 SWF 最高版本。指定 AIR 1.0 或 AIR 1.1 的应用程序只能使用 SWF9 (Flash Player 9) 文件作为初始内容。即使运行应用程序时采用了 AIR 2 运行时也是如此。指定 AIR 1.5(或更高版本)的应用程序可以使用 SWF9 或 SWF10 (Flash Player 10) 文件作为初始内容。
SWF 版本决定了 AIR 和 Flash Player API 的哪个版本可供使用。如果将 SWF9 文件用作 AIR 1.5 应用程序的初始内容,则应用程序将只能访问 AIR 1.1 和 Flash Player 9 API。此外,AIR 2.0 或 Flash Player 10.1 中对现有 API 行为的更改将不会生效。(此原则有一个例外,在运行时当前或今后的修补程序中,可以追溯应用对 API 在安全方面的重要更改。)
对于基于 HTML 的应用程序,在应用程序描述符中指定的运行时版本确定了可供该应用程序使用的 AIR 和 Flash Player API 版本。HTML、CSS 和 JavaScript 的行为始终由已安装 AIR 运行时中所用 Webkit 版本决定,而非由应用程序描述符决定。
AIR 应用程序加载 SWF 内容时,可供该内容使用的 AIR 和 Flash Player API 的版本取决于内容的加载方式。有效版本有时取决于应用程序描述符命名空间,有时取决于正在加载内容的版本,有时取决于已加载内容的版本。下表展示了如何根据加载方法决定 API 版本:
加载内容的方式
|
决定 API 版本的方式
|
初始内容, 基于 SWF 的应用程序
|
已加载
文件的 SWF 版本
|
初始内容, 基于 HTML 的应用程序
|
应用程序描述符命名空间
|
由 SWF 内容加载的 SWF
|
正在加载
的内容的版本
|
由 HTML 内容使用 <script> 标签加载的 SWF 库
|
应用程序描述符命名空间
|
由 HTML 内容使用 AIR 或 Flash Player API(如 flash.display.Loader)加载的 SWF
|
应用程序描述符命名空间
|
由 HTML 内容使用 <object> 或 <embed> 标签(或等效的 JavaScript API)加载的 SWF
|
已加载
文件的 SWF 版本
|
当正在加载的 SWF 文件与正在加载的内容具有不同的版本时,可能会遇到两种问题:
示例
<?xml version="1.0" encoding="utf-8" ?>
<application xmlns="http://ns.adobe.com/air/application/3.0">
<id>HelloWorld</id>
<version>2.0</version>
<filename>Hello World</filename>
<name>Example Co. AIR Hello World</name>
<description>
<text xml:lang="en">This is an example.</text>
<text xml:lang="fr">C'est un exemple.</text>
<text xml:lang="es">Esto es un ejemplo.</text>
</description>
<copyright>Copyright (c) 2010 Example Co.</copyright>
<initialWindow>
<title>Hello World</title>
<content>
HelloWorld.swf
</content>
<systemChrome>none</systemChrome>
<transparent>true</transparent>
<visible>true</visible>
<minSize>320 240</minSize>
</initialWindow>
<installFolder>Example Co/Hello World</installFolder>
<programMenuFolder>Example Co</programMenuFolder>
<icon>
<image16x16>icons/smallIcon.png</image16x16>
<image32x32>icons/mediumIcon.png</image32x32>
<image48x48>icons/bigIcon.png</image48x48>
<image128x128>icons/biggestIcon.png</image128x128>
</icon>
<customUpdateUI>true</customUpdateUI>
<allowBrowserInvocation>false</allowBrowserInvocation>
<fileTypes>
<fileType>
<name>adobe.VideoFile</name>
<extension>avf</extension>
<description>Adobe Video File</description>
<contentType>application/vnd.adobe.video-file</contentType>
<icon>
<image16x16>icons/avfIcon_16.png</image16x16>
<image32x32>icons/avfIcon_32.png</image32x32>
<image48x48>icons/avfIcon_48.png</image48x48>
<image128x128>icons/avfIcon_128.png</image128x128>
</icon>
</fileType>
</fileTypes>
</application>