Skip to main content
Known Participant
June 27, 2016
Question

Open local html file with parameters in default browser

  • June 27, 2016
  • 1 reply
  • 1574 views

I am trying to open a local HTML file in the default browser from AIR, while passing parameters.

var source:File = File.documentsDirectory;

  source = source.resolvePath("test.html");

  var url:String = source.url+"?";

  var urlVars:URLVariables = new URLVariables(); 

  urlVars.var1="One"; 

  urlVars.var2= "Two";

  var request:URLRequest = new URLRequest(url);

  request.data = urlVars;

  navigateToURL(request);

This works fine in debugger. It opens the default browser and the url contains the parameters.

However, when the app is published and installed, the page opens in the default browser But With No Parameters.

Some security setting no doubt.

Any help appreciated.

This topic has been closed for replies.

1 reply

Thomas H
Participant
June 7, 2017

Hi,

i´m having the same issue. Did you ever find a solution for this?

I am trying for hours, using both navigateToURL and ExternalInterface.call - works fine for html + swf, but not when published as an exe.

To clarify - this:

ExternalInterface.call("window.open", url + "#data=someData", "_blank");

or this

navigateToURL(new URLRequest(url + "#data=someData", "_blank");

works fine when published as SWF, but only open the url without parameters when published as air exe.

Any Help?