javascript - onMouseover a flash element? - Stack Overflow

I can't figure out how to fire a javascript event when rolling over a flash element even though it

I can't figure out how to fire a javascript event when rolling over a flash element even though it's on wmode:transparent.

I have tried to put a transparent sensor div over the flash element with the onMouseover event and it worked but the flash became useless and totally unclickable.

Appreciate Any ideas.

Thanks

I can't figure out how to fire a javascript event when rolling over a flash element even though it's on wmode:transparent.

I have tried to put a transparent sensor div over the flash element with the onMouseover event and it worked but the flash became useless and totally unclickable.

Appreciate Any ideas.

Thanks

Share Improve this question asked Jan 7, 2011 at 22:21 CodeOverloadCodeOverload 48.6k56 gold badges133 silver badges223 bronze badges 3
  • just from the top of my mind: put your movie in a div. Use jQuery to calculate where this div is positioned and track the mouse-position. Then you can figure out if the cursor is over the movie. links: docs.jquery./Tutorials:Mouse_Position and api.jquery./position – stian Commented Jan 7, 2011 at 22:26
  • Thanks, but it's not really clean, and it requires jQuery which is not reliable for pure javascript widgets. – CodeOverload Commented Jan 7, 2011 at 22:31
  • Your SWF bees unclickable because you have the div z-indexed above the SWF. That's how z-index is intended to work. – user1385191 Commented Jan 8, 2011 at 7:38
Add a ment  | 

2 Answers 2

Reset to default 8

This is much simpler than ExternalInterface if you're looking for just simple mouse detection on an entire SWF.

Just target the <object> or <embed> tag that's embedding the SWF via Javascript.


document.getElementById("content-banner").onmouseover = over;

function over(evt)
{
 alert("moused over");  
}

http://jsfiddle/p7YkA/

Use the ExternalInterface and call a JavaScript method dispatching the event from Flash.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742310770a4419845.html

相关推荐

  • javascript - onMouseover a flash element? - Stack Overflow

    I can't figure out how to fire a javascript event when rolling over a flash element even though it

    13小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信