在JavaScript中检测Flash对象点击 [英] Detect Flash object click in JavaScript

查看:160
本文介绍了在JavaScript中检测Flash对象点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法可以使JavaScript / jQuery知道什么时候Flash对象被点击了(还有Flash处理点击)?

我试过把使用 position:fixed z-index 的对象顶部的表,并将对象设置为<$ c $所以我可以让我的JavaScript检测使用jQuery的click()来点击哪个列,但是JavaScript(Chromium Linux)从来没有拦截过这些点击。



有没有另外一种方法可以达到这个效果?

解决方案

谢谢Marty Wallace和Darwin!

 < div id ='flash'> 
< object>
< param name ='wmode'value ='transparent'/>
< embed src ='foo.swf'wmode = transparent allowfullscreen ='true'allowscriptaccess ='always'>
< / embed>
< / object>
< / div>

< div id ='output'>< / div>

< script type ='text / javascript'>
$('#flash')。mousedown(function(e){
$('#output')。append('< br> X:'+ e.pageX +'; Y: '+ e.pageY);
});
< / script>

经过测试,Flash对象上的任何点击的XY坐标都将准确地打印到屏幕上与Flash对象的鼠标交互将正常进行。


Is there a way I can have JavaScript/jQuery know when a Flash object has been clicked (and still have Flash process the click)?

I tried putting a table on top of the object with position: fixed and a z-index and the object set to param name='wmode' value='transparent' so I could have my JavaScript detect which column was clicked using jQuery's click(), but the clicks were never intercepted by JavaScript (Chromium Linux).

Is there another way to accomplish this?

解决方案

Thank you Marty Wallace and Darwin!

<div id='flash'>
<object>
<param name='wmode' value='transparent' />
<embed src='foo.swf' wmode=transparent allowfullscreen='true' allowscriptaccess='always'>
</embed>
</object>
</div>

<div id='output'></div>

<script type='text/javascript'>
$('#flash').mousedown(function (e){
    $('#output').append('<br>X: ' + e.pageX + ' ; Y: ' + e.pageY);
});
</script>

After testing, the XY coordinates of any clicks on the Flash object will be accurately printed to the screen and mouse interaction with the Flash object will proceed as normal.

这篇关于在JavaScript中检测Flash对象点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆