Relaxing Flash security for local swf accessing local files
Here's my situation - I have a 3D Engine written in C++ and DirectX. It uses Awesomium for GUI windows.
This allows me to use HTML and Javascript for the GUI, then render it within a 3D environment. Awesomium wraps the Chromium browser to render the HMTL. All working fine including SWF playback.
My problem comes 开发者_Go百科when I try to communicate with the SWF movie with Javascript (Awesomium allows me to call Javascript from within my C++ application) and Actionscripts ExternalInterface. I get the dreaded security error. By adding various statements to the SWF file and adding the path to the SWF file to the flash player Global Security Settings list, it works.
Now I can't exactly expect my end users to all modify their flash player Global Security accordingly so I am hoping there is a workaround.
I have a local application, calling a local html file which loads a local swf file. My local application is communicating with this local SWF file, errr locally. No network transaction.
So why the sandboxing? Can I not tell the swf movie to trust a particular sender, my application? I am on flash 8/AS2 by the way.
Thanks for your help
Simon
I'm not sure these settings are applicable in your case, or if you already use them, but two things you can do to "relax" security for communication between ActionScript and JavaScript are:
In ActionScript: System.security.allowDomain("*")
In the <object>
and/or <embed>
tag for the swf in the HTML, set the allowScriptAccess parameter to "always".
精彩评论