Security Sandbox in AS3

kevin picture kevin · Nov 20, 2008 · Viewed 17.7k times · Source

What is a security sandbox violation, and how do I override it? I'm making a project in FlashDevelop, and today, it will not load external files, even though it had been previously. It gives the following output:

************* Security Sandbox Violation ********* Connection to file:///C|/Documents%20and%20Settings/Kevin.PC885314341208/Desktop/Import%20.txt/StockData/1.txt halted - not permitted from file:///C|/Documents%20and%20Settings/Kevin.PC885314341208/Desktop/Import%20.txt/import.swf

I hope this isn't a serious problem.

Thanks for any help.

Answer

aaaidan picture aaaidan · Dec 1, 2008

The error message you posted shows that you're trying to load a local file from a local swf. This error can be fixed for your scenario.

In FlashDevelop, set "Use Network Services" to false (Project Properties -> Compiler Options tab). This will prevent your swf from accessing the internet but will let you load local files. Setting it to true will allow internet access but not access to local files.

In Flash, the setting is under "Publish Settings", Flash tab. It's called "Local playback security" and the settings are "Access local files only" or "Access network only". It's the same setting as in FlashDevelop, just a different name.

You can also switch the "Use Network" flag of a swf file after publish/compile by using the Adobe's free+open Local Content Updater.