Protective sandbox in AS3

What is a security sandbox violation and how can I override it? I am doing a project in FlashDevelop, and today it will not load external files, even if it was previously. It gives the following result:

************* Sandbox security violation ********* Connection to file: /// C | /Documents%20and%20Settings/Kevin.PC885314341208/Desktop/Import%20 .txt / StockData / 1.txt stop - prohibited File: /// C | /Documents%20and%20Settings/Kevin.PC885314341208/Desktop/Import%20.txt/import.swf

Hope this is not a serious problem.

Thanks for any help.

+4
source share
4 answers

The error message that you indicated indicates that you are trying to load a local file from local swf. This error can be fixed for your scenario.

In FlashDevelop, set the Use Network Services option to false (Project Properties โ†’ Compiler Options Tab). This will prevent your swf from accessing the Internet, but allow you to upload local files. Setting it to true will allow access to the Internet, but not access to local files.

In Flash, the option is located in the "Publish Settings" section of the Flash tab. It is called "Local playback security", and for the settings, "Access only local files" or "Only access to the network." This is the same parameter as in FlashDevelop, just a different name.

You can also switch the "Use network" flag in the swf file after publishing / compiling with the free + open Local Content Updater .

+11
source

A local file is loaded, which is not allowed. However, since you are developing this, you can of course allow it.

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

Edit: I could add that if you run it with network support disabled, it will work (this is for development purposes). This happens, for example, when you run it from the Flash IDE, which explains why it might work before?

+4
source

You cannot load desktop files when you try to run SWF through a web browser. Flash does not give you access to the local hard drive, as this will be a serious security issue. You will need to place these files on the server somewhere and pass Flash the direct URL.

+2
source

OK I got it to work by publishing it using FlashDevelop, built into flashplayer (I don't know how to describe it better). I could not use the security settings suggested by Antti.

0
source

All Articles