简体   繁体   English

如何捕获Flash对象的点击事件

[英]How to capture click event of Flash Object

i have a div which has onclick event... On the Onclick of 1st div it need to call onclick of flash object which is 2nd div.. 我有一个具有onclick事件的div ...在第一个div的Onclick上,它需要调用第二个div的Flash对象的onclick。

Is there any thing in java script which captures onclick of flash.. Java脚本中是否有任何东西可以捕获Flash的onclick。

Thanks 谢谢

You'll need to use ExternalInterface for flash and Javascript to communicate with one another. 您需要使用用于Flash和Javascript的ExternalInterface相互通信。

It's pretty strait forward. 向前挺直。

To send message from Flash to Javascript, use call 要将消息从Flash发送到Javascript,请使用call

ExternalInterface.call("some_js_function",param1,param2, etc);

To call a Flash function from Javascript, 要从Javascript调用Flash函数,

  1. set a callback in flash 在Flash中设置回调

    ExternalInterface.add_addCallback("the_external_name",a_flash_function); ExternalInterface.add_addCallback(“ the_external_name”,a_flash_function);

  2. call the function with javascript 用javascript调用函数

    document.getElementById('flashobjectid').the_external_name(param1, param2, etc) document.getElementById('flashobjectid')。the_external_name(param1,param2等)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM