最近项目中遇到一些flash部署后出现的安全策略限制的问题,一一正确配置如下:
具体环境:页面在A.com服务器下,flash在B.com下;
1.flash获取A.com下的接口数据:
A.com 下的crossdomain.xml中需要配置
<allow-access-from domain=”*.B.com”/>
2.flash向A.com提交数据
A.com 下的crossdomain.xml中需要配置
<allow-http-request-headers-from domain=”*.B.com” headers=”*” secure=”false”/>
3.flash调用A.com下所属页面AAA.htm的js函数
1.flash.system.fscommand() 函数
2.flash.net.navigateToURL() 函数(当指定 navigateToURL(”javascript: alert(’Hello from Flash Player.’)” 等脚本访问语句时)
3.flash.net.navigateToURL() 函数(当 window 参数设置为”_top”、”_self”或”_parent”时)
4.ExternalInterface.call() 方法
AAA.htm 中应该在 PARAM 或 EMBED 标签中进行设置AllowScriptAccess 为”always”;
4. A.com下flash所属页面AAA.htm 中js调用 flash中的函数
需要在flash中写上
Security.allowDomain(”*”);
Security.allowInsecureDomain(”*”);
Recent Comments