我有一个 flash swf 文件,但无法访问其源代码。我可以仅使用 JavaScript 来调用/启动 swf 文件中的 flash 函数的操作吗?
或者 swf 是否需要事件监听器来响应 JavaScript?
最佳答案
您无法与 SWF(至少是 AVM2(基于 AS3)SWF)通信,除非它已在其中注册了回调方法。 ExternalInterface
类有一个 addCallback()
method那:
Registers an ActionScript method as callable from the container. After a successful invocation of
addCallBack()
, the registered function in Flash Player can be called by JavaScript or ActiveX code in the container.
关于javascript - 通过 JavaScript 调用 Flash swf 中的操作的工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1581976/