0 Replies Latest reply on May 31, 2008 6:12 AM by prof.hate

    passing arguments to AIR application from the browser

      My AIR application requires arguments (from the "invoke" event), and if I launch my app on my desktop, the arguments are read properly. I've also been able to install & launch my application from the browser, using the installer badge provided in the SDK as a starting point. My problem is that I can't pass arguments to my application from the browser. For example, in my app launcher I write:

      _air.launchApplication( _applicationID,_publisherID, ["phat","1","test","1"] );

      My application is indeed launched, but event.arguments is empty in the INVOKE event received by my application.

      I've heard of problems with passing non-alpha-numeric characters in the arguments, but I can't seem to pass in any arguments whatsoever (from the browser). As I said before, arguments given on the command line are read without any problem. It's very puzzling.

      I do have "<allowBrowserInvocation>true</allowBrowserInvocation>" in my AIR application by the way.

      I'm going to tinker with it some more, but I think I may need a suggestion here! I'm sooo close, I just need to pass in these darned arguments from the browser!

      edit - of course, as soon as I post that, I find the answer. I need to listen for the "BrowserInvokeEvent", because when my app is launched from the browser, it'll receive that event as well as the "InvokeEvent". Unless it's already running, in which case it'll only receive the "BrowserInvokeEvent". I haven't tested this yet, but I'm almost certain this is my mistake.

      Nothing to see here, move along :p