as3的Error #2060 安全沙箱冲突ExternalInterface
错误案例:
flex程序Error #2060: 安全沙箱冲突:ExternalInterface调用者http://file.51yuncai.com/12/flash/duiduipeng.swf不能
访问http://t.51yuncai.com/product_pk_list.php?type_id=3&product_id=1。
解决方法:
1. 标签形式的写法(即通过标签的形式加载的swf):
<object type="application/x-shockwave-flash" data="/player/loader.swf"
width="100%" height="100%" id="1g1gPlayer" bgColor="#333333">
<param name="movie" value="/player/loader.swf"/>
<param name="allowFullScreen" value="true" />
<param name="allowScriptAccess" value ="always" />
</object>
即多加一行代码: <param name="allowScriptAccess" value ="always" />
2. 脚本形式的写法(即通过脚本(如js)语言的形式加载swf):
var so = new SWFObject("test.swf", "t1", "800", "550", "9", "#000000");
so.addParam("quality", "high");
so.addParam("name", "t1");
so.addParam("id", "t1");
so.addParam("algin", "middle");
so.addParam("allowScriptAccess", "always");
即多加一行代码: so.addParam("allowScriptAccess", "always");
3. 安装的flashplayer版本不一致,请卸载后重新安装flashplayer。