views:

245

answers:

3

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

+1  A: 

I know this is weird but for local files loaded through the flash player you probably just need to hit this page. Then you'll add your swf or your folder of swf's into the whitelist and they'll be able to access outside resources magically.

Chuck Vose
they are _not_ local files. everything i am loading is on the server, so that is what i don't understand. i also have no idea what is going on with that page... ???
jml
No, but you're testing your swf locally correct? I know that page is confusing, there's an app at the top where you can add in your swf to the whitelist for network connections. Somehow this gets stored in your computer and makes the problem go away.
Chuck Vose
I have been testing locally and all is working there. I am now wanting to put the website up online and this seems to be the source of the problem. I mentioned in my post that the problem only occurs when I export a release build. At that point the compiled SWF created runs neither locally or server-side.
jml
Ah, I understand now. Apologies. I misread the original post.
Chuck Vose
+2  A: 

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!

yn2
Cool. Where do I put the crossdomain.xml file? In the root of alubow.com/* or one level up?
jml
Nevermind. I figured out that it needs to go in the root of mydomain.com/*. Thanks so much for your help, yn2.
jml
+1  A: 

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.

justkevin