0
votes

I'm trying to port an existing web app (ActionScript 3 only project) to AIR, to run as a standalone application. One of its features is opening urls in a browser window. But calling navigateToURL(new URLRequest(url)) throws this SecurityError:

SecurityError: Error #2193: Security sandbox violation: navigateToURL: app:/AIRDigE.swf cannot access http://www.youtube.com/watch?v=xCPwAr0xnGE. at global/flash.net::navigateToURL()

when run from Flash Builder 4.

Googling doesn't really help me with this specific error number.

Adobe's reference on Security Sandboxes states that any AIR application running with Security.sandboxType==Security.APPLICATION (which my application uses) should be able to connect to any domain, but apparently that doesn't count for me.

Any ideas?

Thanks, Frank

3
What version of the Flex SDK are you using?user562566
I'm using Flex SDK 4.1. Could that make a difference?frankhermes
I don't think so, I was asking in case you were using a beta or preview version. Honestly I tried this in both flash CS5 and Flash Builder worked just fine. Stumped on this one, unless you've modified your install or something.user562566

3 Answers

2
votes

Sorry folks, this morning I found the answer myself: the url that I passed into the URLRequest had a space in front of it (it was loaded from an xml feed that is evidently producing faulty urls).

So it seems that a url with an invalid protocol causes that error, and putting a trim() around the url fixed it.

1
votes

I was getting this error because of using double backward slashes in the web link like "http:\\www.youtube.com"

Where as I supposed to use "http:*//*www.youtube.com"

0
votes

try using URLRequest with navigateToURL

navigateToURL(new URLRequest("http://www.youtube.com"));

UPDATED:

navigateToURL(new URLRequest("http://www.youtube.com"),"blank");