javascript - 有没有办法用本地内容从actionscript执行js函数?

标签 javascript flash actionscript local

例如,当 html 文件和 swf 文件都使用 file: 协议(protocol)时,我尝试从 actionscript 执行类似 window.alert 的函数.

有人知道有什么方法可以做到这一点吗?

无需更改全局闪存安全设置

最佳答案

看完 Controlling access to scripts in a host web page 貌似不行.

For SWF files running locally, calls to these APIs are successful only if the SWF file and the containing web page (if there is one) are in the local-trusted security sandbox. Calls to these methods fail if the content is in the local-with-networking or local-with-filesystem sandbox.

然后this page在本地沙箱上基本上说除非 swf 位于用户或安装程序需要将其放入的“本地受信任的沙箱”中,否则它将无法工作。

This blog post关于“本地文件系统沙箱”说:

First, I think the documentation here is a bit too generous. SWFs loaded from the local file system do face some restrictions. The most relevant restrictions are probably:

  1. The SWF cannot make a call to JavaScript (or vbscript), either through URL or ExternalInterface
  2. The SWF cannot call a HTTP or HTTPS request.
  3. Querystring parameters (ex. Blah.php?querystring=qs-value) are stripped and will not be passed (even for requests to local files)

关于javascript - 有没有办法用本地内容从actionscript执行js函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5280656/

相关文章:

android - 在Unity中打开SWF游戏

javascript - 表单验证和所有后续代码不执行

javascript - PHP 表传递给 javascript 中的 var

javascript - 所以我想在某种情况下停止程序

flash - 具有自定义刻度和轴的 Flex 图表

actionscript-3 - 缩放和裁剪具有固定尺寸的图像

javascript - vue cli 使用目标库 : "require is not defined" when component is imported 构建

flash - 初学者 : Dynamically inserting a frame to a MovieClip in Haxe/ActionScript3

apache-flex - 刷新现有的 DataGrid ItemRenderers

actionscript-3 - Actionscript 3 和动态蒙版