Home > Adobe AIR, Adobe Flex > The simpliest way to launch another AIR application from an AIR application

The simpliest way to launch another AIR application from an AIR application

I’ve searched the web for a method of launching another AIR application from an AIR application and the only way was to load a chunk of SWF, like David does here.

The main reason for searching the simplest way is based on the fact that AIR supposed to be desktop application and to take into consideration that the Internet connection might be unavailable at some point. So, how to launch another application if there is no Internet connection to bring the air.swf file from Adobe’s server?

Just like that:

1. You know the appID of the application your are trying to launch

2. You know the publisherID of that application too

3. Import the following undocumented class adobe.utils.ProductManager (import adobe.utils.ProductManager);

4. Write where you need the following:

myLauncher = new ProductManager();

var myArguments:Array = ["-launch", appID, publisherID, theOtherAppArguments];

myLauncher(myArguments.join(” “));

That’s it! Now you can fast launch your other application, without needing the air.swf piece that will do this for you. Of course, if you need to do checks (like if that another application is installed) you will need to write more code and do your own research on this undocumented class.

Related Posts

  1. benz
    May 28th, 2008 at 02:54 | #1

    Hey Badu,
    I can not get this to work :-( I get some compile errors. Can you post some more complete example or just verify that this is the correct code? It`s really hard to find any usefull information about this but if it really works it would be really cool!
    Thanks
    Benz

  2. May 30th, 2008 at 14:56 | #2

    < mx :WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()" >
    < mx :Script >
    < ![CDATA[
    import adobe.utils.ProductManager;

    private var pMan:ProductManager;
    private var appID:String = "Lines";
    private var pubID:String = "82828E1ECB03D562A33287577F278967E40D9944.1";

    private function init():void{
    pMan = new ProductManager('airappinstaller');

    var launchArgs:Array;
    launchArgs=["-launch", appID, pubID, ""];
    pMan.launch(launchArgs.join(" "));
    }
    ]]>
    < / mx : Script >
    < / mx : WindowedApplication >

    1. Make sure that your app is installed!
    2. Search for your appID in the app directory, under Meta-Inf folder, AIR subfolder, publisherid

  1. No trackbacks yet.
You must be logged in to post a comment.