Search code examples
xmlflashactionscript-3urlloader

Unexpected security issue - localy in browser vs. from server


I'm writing mp3 player in flash for my website. It needs first to load xml file(from external source) with .mp3 info then .mp3 file. I use URLLoader.load to load xml file.

When i run my .swf in a browser(from local source) it throws SecurityException so i have to edit Global Security Settings adding the path to file and it works.

When i upload it on the server, and run from server, it also throw SecurityError but I can't figure out if editing Global Security Settings will help(or rather why it's not working. I tried adding every possible path and it doesn't work).

Is there any solution? Cheers


Solution

  • If placing a cross domain file on the remote server isn't an option, then you will need to use a proxy script (e.g. PHP) that you call on your server. It can then load the XML without worrying about Flash's security sandbox, and Flash thinks the XML it has received has come from your server.