1 javascript flash events event-handling
有没有一种方法可以检测Flash对象上发生的点击(或mousedown,mouseup)?
我试过了:
我需要这个在IE6 +,Firefox 2+和Safari 3+中工作.
谢谢你的帮助!戴夫
小智 6
我在http://progproblems.blogspot.com/2009/08/javascript-onclick-for-flash-embeded.html找到了这个
1) Set the param wmode to transparent. This allows the object containing the flash to receive the javascript onclick.
2) Use onmousedown insted of onclick. In spite of using wmode transparent, some browsers still wont call the onclick, but they do call onmousedown.
The code looks like this:
<div onmousedown="clickBanner(1)">
<object>
<param name="movie" value="3.swf">
<param name="wmode" value="transparent" />
<embed wmode=transparent allowfullscreen="true" allowscriptaccess="always" src="3.swf"></embed>
</object>
</div>
Run Code Online (Sandbox Code Playgroud)
它适合我的需要=)