Can One AIR Application Launch Another?

| No Comments

Commenter madhu asked whether one AIR application can launch another. The answer is yes, albeit indirectly.

There is no API (at least, not yet) that allows AIR applications to directly launch other applications. However, AIR applications can be launched from a web page via the AIR Browser API. (Note that applications have to opt-in to be launched in this way.) And since you can host a web page in side an AIR application, it's possible to make this work with a couple of levels of indirection—and one click from your user.

Here's the basic recipe:

  1. In the application-to-be-launched, make sure <allowBrowserInvocation> is set in its descriptor.
  2. In the launching application, create an instance of HTMLLoader.
  3. Write a SWF that will, on a user click, call the Browser API launchApplication() method. (You can use the sample badge SWF in the SDK for this.)
  4. Load this SWF into your HTMLLoader instance.

The click from the user is required for reasons previously discussed.

Final note: This method can also be used to enable the installation of one AIR application from another.

Leave a comment

About this Entry

This page contains a single entry by Oliver Goldman published on December 10, 2008 11:24 AM.

Changes to HTMLLoader.loadString() in AIR 1.5 was the previous entry in this blog.

Using TLS Client Authentication with AIR Applications is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.