从另一台服务器的嵌入式 swf 调用 externalinterface.call 在 Firefox 中不起作用

发布于 2024-07-16 15:22:06 字数 313 浏览 2 评论 0原文

我在服务器A上有一个index.html。

在index.html中我嵌入了来自服务器B的swf。swf

包含一个init flash.external.ExternalInterface.call("alert", "externalalert");

当我在服务器 B 上运行 swf 时,它可以工作,当我通过服务器 AI 上的 index.html 运行 swf 时,会得到:安全沙箱违规:ExternalInterface 调用者...

它在 IE 中工作。

有谁知道我做错了什么。

谢谢!

I have an index.html on server A.

In index.html I embed a swf from server B.

The swf contains a init with
flash.external.ExternalInterface.call("alert", "externalalert");

When I run the swf on server B it works, when I run the swf through the index.html on server A I get an : Security sandbox violation: ExternalInterface caller...

It does work in IE.

Does anybody know what I'm doing wrong.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦行七里 2024-07-23 15:22:06

修复方法是添加

System.security.allowDomain("*");

您的 AS 代码。 ExternalInterface 要求在执行 HTML-SWF 跨脚本时设置 allowDomain

请注意,您还需要在 swf 嵌入标记中设置 allowScriptAccess="always" 以允许跨脚本。

The fix is to add

System.security.allowDomain("*");

in your AS code. ExternalInterface requires the allowDomain to be set when HTML-SWF cross-scripting is performed.

Note that you will also need to set allowScriptAccess="always" in the swf embed tags to allow cross-scripting.

清晨说晚安 2024-07-23 15:22:06

你没有做错什么。 这是Flash播放器的限制。 不同域之间的交互是不允许的。 您可以尝试使用crossdomain.xml。 (但我不知道这是否适用于ExternalInterfaces)。
更多信息可以在这里找到:

You are doing nothing wrong. This is a restriction of the Flash player. Interacting between different domains is not allowed. You could try to use a crossdomain.xml. (But I do not know if this works you ExternalInterfaces).
More Information can be found here:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文