Can One AIR Application Launch Another?

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.

2 Responses to Can One AIR Application Launch Another?

  1. Gummistiefel says:

    This is not a viable solution … although it may have worked on your machine .. there are several things that could happen .. the most likely one is that the user will see a bunch of popups saying he is trying to execute an application form the internet .. in IE on windows he’ll most probably see an open/save dialog .. you did not see it probably because you might have the office plugins enabled in your browser but this need not be the setting on the users machine

  2. i think it works fine, eventhough sometimes a lot of pop ups come on up