3 Replies Latest reply on Jul 7, 2008 7:49 PM by Oliver Goldman

    Problem passing arguments with air.swf

      I'm attempting to launch my AIR application using launchApplication() in air.swf. I'm having problems passing arguments to my application due to what appears to be some restriction in allowed characters. To get around this, I've even tried URL encoding and Base-64 encoding my arguments to make them more friendly, but it's still failing:

      Error: Invalid argument: PG5vIGlkZW50aWZpZXI+
      at AIR$/escapeArguments()
      at AIR/launchApplication()
      at adlm_launcher/onDownloadClick()[E:\adlm\launcher\src\adlm_launcher.mxml:181]

      It seems that any kind of punctuation is not allowed in arguments. URL encoding them doesn't work either because the % is rejected. Is there any other way around this?
        • 1. Re: Problem passing arguments with air.swf
          Oliver Goldman Adobe Employee
          The allowed characters are A-Za-z0-9:-=

          Encoding other values is a reasonable approach, but you'll have to pick an encoding scheme that restricts itself to this character set.

          • 2. Re: Problem passing arguments with air.swf
            billbrasky66 Level 1
            Is there a reason it is so restrictive? You can't even pass a URL to your application as-is. Could you at least add "+" and "/" so Base-64 will work?

            • 3. Re: Problem passing arguments with air.swf
              Oliver Goldman Adobe Employee
              Yes; it's a security restriction. Browser invocation require process creation, and many process creation APIs giving special meanings to certain characters. Letting those characters through has in the past been a source of security vulnerabilities. While we also try to avoid using APIs with this behavior, extra layers of defense are also good.

              I think + and / may actually be safe choices; you make a good point that they're useful for Base64. If you could submit a feature request at www.adobe.com/go/wish, we'll definitely consider it.

              Another option, btw, is to use the LocalConnection API to pass data between the web page and your application once your app is launched. LocalConnection has fewer restrictions on the data passed.