简体   繁体   English

单击Flash(swf对象)

[英]Flash (swf object) on click

I have made a simple flash button. 我做了一个简单的闪光灯按钮。 I want it so that on click = myJSfunction() 我想要它,以便单击= myJSfunction()

I tried adding an on click to the div which holds the flash object but the function is never called. 我尝试将div添加到包含Flash对象的div上,但从未调用该函数。 What is the correct way to do this? 正确的方法是什么?

Thanks in advance 提前致谢

You need to use ExternalInterface to push the flash button's click event out to your javascript function, I think it swallows all clicks otherwise. 您需要使用ExternalInterface将Flash按钮的click事件推送到您的javascript函数中,否则我认为它会吞噬所有单击。

http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html

This is very similar to onMouseover a flash element? 这与onMouseover Flash元素非常相似吗?

Add the mouse listener to the flash <object> or <embed> element itself, instead of the <div> . 将鼠标侦听器添加到flash <object><embed>元素本身,而不是<div>

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

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