1 Reply Latest reply on Aug 18, 2009 10:27 AM by msupport

    InvokeEvent from web browser,  parameters/arguments are not getting set with air.swf launchApplication

    FlexmasterFred

      Hi all,

       

      I have an AIR application that when I run it from the flex ide with a profile that sets all of the command line arguments I'm expecting to get in the application and it runs fine that way.  So I don't think there is anything wrong with my InvokeEvent handler.  It get's called and it can read any command line arguments passed to it.

       

      However, when I try to invoke my AIR app from a web browser using the air.swf launchApplication function the arguments I'm passing to it get lost.  The AIR application launches.  However, the arguments I'm logging the start with are not set.  I'm using the simple instructions from this page:

       

      http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7e15. html#WS5b3ccc516d4fbf351e63e3d118666ade46-7cd2

       

      Am I missing something?  Can someone share a working example?

       

      Thanks,

      Fred

        • 1. Re: InvokeEvent from web browser,  parameters/arguments are not getting set with air.swf launchApplication
          msupport

          Fred,

           

          You can use BrowserInvokeEvent.BROWSER_INVOKE to capture the data if you are launching the adobe application from your browser.

           

          Here is how it can be done from a javascript:

           

          air.NativeApplication.nativeApplication.addEventListener(air.BrowserInvokeEvent.BROWSR_INV OKE, onInvoke);

           

           

          function onInvoke

          (

              event

          )

          {

               var parms = new Array();

              if (event.arguments[0].length >0)

              {

                  // assuming that your argument is like "arg1 arg2"

                  parms = event.arguments[0].split("  "); 

              }

          }

           

           

          Adobe has several bugs in the Air library because I can not pass an array as parameter. I have to convert the array to string with spaces (it does not take | or any other characters).

           

          Adobe Air is buggy but I have no choice to use it for now until some other vendor develop a better solution......

           

          Mehran