开发者

onMouseover a flash element?

开发者 https://www.devze.com 2023-02-03 07:36 出处:网络
I can\'t figure out how to fire a javascript event wh开发者_开发知识库en rolling over a flash element even though it\'s on wmode:transparent.

I can't figure out how to fire a javascript event wh开发者_开发知识库en 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


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.net/p7YkA/


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号