Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Security Sandbox in AS3

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.

like image 290
kevin Avatar asked Dec 03 '22 16:12

kevin


2 Answers

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.

like image 168
aaaidan Avatar answered Dec 31 '22 07:12

aaaidan


You're loading a local file, something that's not permitted. However, as you're developing this you can of course allow this.

Add your project folder to the trusted locations: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

Edit: I might add that if you run it with networking disabled it will work (this is for development purposes). This happens for example when you run it from the Flash IDE, which would explain why it may have worked before?

like image 21
Antti Avatar answered Dec 31 '22 06:12

Antti