Flex - 安全沙箱违规 - 错误#2048

时间:2011-03-01 16:10:40

标签: actionscript-3 flash crossdomain.xml

所以,如果我把 - http://xxx.xx.xx.x/website/website.html并尝试使用swf中的HTTPService联系 - https://yyy.yy.yy.y/resources/script,我会收到沙箱错误。 如果我将 - https://yyy.yy.yy.y/crossdomain.xml放入浏览器并访问它,那么crossdomain文件中的所有内容都可以。 我回去尝试使用HTTPService - http://xxx.xx.xx.x/website/website.html现在一切正常,直到我关闭我认为清除缓存的浏览器。

******** *********为crossdomain.xml

<?xml version="1.0" ?>
<cross-domain-policy>
  <site-control permitted-cross-domain-policies="master-only"/>
  <allow-access-from domain="*"/>
  <allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>

********动作脚本*************

Security.loadPolicyFile("https://xxx.xx.xx.x/crossdomain.xml");

2 个答案:

答案 0 :(得分:12)

更改以下行:

<allow-access-from domain="*"/>

为:

<allow-access-from domain="*" secure="false" />

您可以在adobe.com上阅读更多相关信息......

http://kb2.adobe.com/cps/142/tn_14213.html

答案 1 :(得分:2)

我们发现Chrome会拒绝自签名SSL证书,但Firefox和Safari将会继续推进。尝试使用其他浏览器,看看它是否适合您。