jml
jml

Reputation: 1806

AS3: Security sandbox violation

I want to go live with my site.

...but I need help with a security violation I am incurring. I've seen various threads on this forum regarding a crossdomain.xml file to include and link to, but I don't get it... no matter what I try I still end up with the same result. You'll note below that it is not recommended to use crossdomain hacks.

FWIW, this only happens when I export a release build... I can load the php data w/out an issue in my debug/developing phase locally in Flex.

What gives? When I make a PHP based request for data I always get this error popping up:

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://alubow.com/jml_testing/viewable/alubow_project.swf cannot load data from http://www.alubow.com/jml_testing/foldergrab.php?ipath=assets/bitmap/portrait_thumbs/&tpath=assets/bitmap/portrait_imgs/. at utils.php::DirectoryReader() at alubow_project/newScroller() at alubow_project/mainClickOut()

Is there code I need to add to get this to work? Do I need to configure the server I am using? I will need to go live with this site soon and these errors I am getting both locally and serverside (via a browser) are unacceptable.

COULD THIS BE A PROBLEM WITH THE FLASH PLAYER I HAVE INSTALLED? I have the debugger version of flash player 10.

jml

Upvotes: 2

Views: 3024

Answers (3)

Chuck Vose
Chuck Vose

Reputation: 4580

I know this is weird but for local files loaded through the flash player you probably just need to hit this page. Look near the top right for something that looks like an example image. It's actually a Flex application. Click successive tabs until you read the Global Security Settings panel (currently 3rd from the left, with an image of a globe and padlock). Select the "Edit locations" menu, and choose "Add location". You can then add your swf or your folder of swf's into the whitelist and they'll be able to access outside resources magically.

Upvotes: 1

justkevin
justkevin

Reputation: 3199

It may be because your app is requesting from www.alubow.com when hosted from alubow.com, which triggers a request for http://www.alubow.com/crossdomain.xml, which doesn't exist. You could refer to your app as www.alubow.com/jml_testing/viewable/alubow_project.swf and avoid the error.

Alternately, you could add a crossdomain.xml file to www.alubow.com.

Upvotes: 1

David Salzer
David Salzer

Reputation: 872

The problem is with the www prefix. I guess you are trying to load a page with out the www subdomain and the URL you are looking for does have that prefix.

Now, what you need to do is one of the following:

  • change the request url
  • add both www.yourdomain.com And yourdomain.com to the crossdomain.xml
  • call the url dymanicaly. this is the best solution but needs some more work. you can get it done using ExternalInterface and connection to JS here. OR you can use the BrowserManager.

Enjoy!

Upvotes: 3

Related Questions