Tool to invoke actions in Flash swf via JavaScript

依然范特西╮ 提交于 2019-12-24 08:26:56

问题


I have a flash swf file without access to it's source. Can I use only JavaScript to invoke/initiate the action of the flash functions within the swf file?

Or does the swf need active listeners to respond to JavaScript?


回答1:


You cannot communicate with an SWF (at least an AVM2 (AS3 based) SWF) unless it has registered callback methods in it. The ExternalInterface class has an addCallback() method that:

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.



来源:https://stackoverflow.com/questions/1581976/tool-to-invoke-actions-in-flash-swf-via-javascript

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!