Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

onMouseover a flash element?

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

like image 338
CodeOverload Avatar asked Dec 01 '25 08:12

CodeOverload


2 Answers

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.

like image 36
weltraumpirat Avatar answered Dec 03 '25 20:12

weltraumpirat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!