打开通过URL原住民AIR应用程序? [英] Open a Native AIR app via URL?

查看:162
本文介绍了打开通过URL原住民AIR应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想人们不得不通过URL推出原生AIR应用程序的能力。我的AIR应用程序会读一些参数就可以了,并开到正确的状态。

I'd like people to have the ability to launch a Native AIR app via URL. My AIR app would read some parameters on it and open to the correct state.

因此​​,用例是有人将浏览我们的网站,然后就点击一个链接,它会打开本机桌面应用程序到的关联到他们的链接正确的内容。

So the use case would be someone would be browsing our site, then would click on a link, and it would open the native desktop app to the correct content that's associated to their link.

我知道iTunes的做到这一点,和其他应用程序支持它。

I know iTunes does this, and other apps support it.

我知道AIR(非本地)安装程序支持这一点。

I know AIR (non-native) installer supports this too.

我不知道我是否可以使用本机AIR应用程序做到这一点(.exe或安装的.dmg)。

I don't know if I can do this with a native AIR app (.exe or .dmg install).

编辑:这是为桌面

推荐答案

好了,所以你这是怎么做到这一点的桌面应用程序。

Ok so this is how you do that for desktop applications.

- 第一全部设置allowBrowserInvocation设置为true,则应用程序描述符文件:     真正 (http://livedocs.adobe.com/flex/3/html/help.html?content=File_formats_1.html#1043413)

-First of all in the application descriptor file set allowBrowserInvocation to true: true (http://livedocs.adobe.com/flex/3/html/help.html?content=File_formats_1.html#1043413)

-The应用程序必须听BrowserInvokeEvent在开始 然后你就可以使用传递给应用程序像这样的参数:

-The application must listen to BrowserInvokeEvent at the start and then you can use the arguments passed to the application like this:

public function onInvokeEvent(invocation:InvokeEvent):void 
{
    arguments = invocation.arguments;
    currentDir = invocation.currentDirectory;
}

- 你只能从SWF启动AIR应用程序。在浏览器中的SWF文件可以通过调用从的 http://airdownload.adobe.com/air/browserapi/air.swf 一旦加载air.swf文件后,SWF文件便可以调用air.swf文件的launchApplication()方法,如下面的code:

-You can launch an AIR APP only from an SWF. A SWF file in the browser can launch an AIR application by calling the launchApplication() method in the air.swf file loaded from http://airdownload.adobe.com/air/browserapi/air.swf Once the air.swf file is loaded, the SWF file can call the air.swf file's launchApplication() method, as in the following code:

var appID:String = "com.example.air.myTestApplication";
var pubID:String = "02D88EEED35F84C264A183921344EEA353A629FD.1";
var arguments:Array = ["launchFromBrowser"]; // Optional
airSWF.launchApplication(appID, pubID, arguments);

有关更多信息 的http://livedocs.adobe.com/flex/3/html/help.html?content=app_launch_1.html#1038008

希望它帮助。

这篇关于打开通过URL原住民AIR应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆