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
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.
You need to set up a cross-domain-policy file. Please check the security chapter from programming as3. From the left panel select Programming ActionScript 3.0 -> Flash Player security -> Loading data
.
精彩评论