I run it from flex builder with debug enabled. How do I run swf off local server path from within flex builder?
How do I set Security.sandboxType related to flash player? When I try to see it in my application through debugger it says "remote". I think I need to set it to one of the following from the adobe manual pages...
Security.sandboxTypehas one of the following values:
Security.REMOTE)—This file is from an Internet URL and operates under domain-based sandbox rules.
Security.LOCAL_WITH_FILE)—This file is a local file, has not been trusted by the user, and it is not a SWF file that was published with a networking designation. The file may read from local data sources but may not communicate with the Internet.
Security.LOCAL_WITH_NETWORK)—This SWF file is a local file, has not been trusted by the user, and was published with a networking designation. The SWF file can communicate with the Internet but cannot read from local data sources.
Security.LOCAL_TRUSTED)—This file is a local file and has been trusted by the user, using either the Flash Player Settings Manager or a FlashPlayerTrust configuration file. The file can read from local data sources and communicate with the Internet.
Security.APPLICATION)—This file is running in an AIR application, and it was installed with the package (AIR file) for that application. By default, files in the AIR application sandbox can cross-script any file from any domain (although files outside the AIR application sandbox may not be permitted to cross-script the AIR file). By default, files in the AIR application sandbox can load content and data from any domain.
Any input on how to set it would be greatly appreciated. Thanks!
You need to change the security sandbox type of your swf generated by Flex.
Just do the next:
- Open the Project Properties ( Right click on the main project folder and then "Properties")
- Go to "flex compiler" section in the left side.
- Type the following in the "Additional compiler arguments" field. ( -use-network=false )
Then just recompile the application and now your swf will be in a local-with-file system sandbox.
I followed your instructions. It still comes up with "remote" as the security type. If I run the swf file directly as suggested by gilado, it does run properly. However, I lose the benefit og the debugger in that case. Any thoughts on how I can get the security level changed to support local file access (i did use the settings manager to point to the directories from where I try and read .jpg files, .swf files etc.). Thanks!
You use the Global Security Settings Manager to point to the directory where your swf is ??? That should've worked too. When you do that you set your swf to a local-trusted sandbox and that swf should be able to load the assets. I think maybe the path can be wrong. Try making all your computer drive appear in the Settings Manager (temporaly) and try to re-launch your swf. Just to make sure that can also load the assets. If it works then the exact path is wrong.
To call debugger from server:
in project properties open Flex Build Path
The last field: Output folder URL.
click on the arrow near Debug button and select "Other"
Put urls there for debug, profile and run options.