views:

1101

answers:

2

Is there a way JavaScript can detect clicks (or mousedown, mouseup) that happen on Flash objects?

I have tried:

  • Attaching the 'mouseup', 'mousedown', and 'click' events to the Flash object using attachEvent/addEventListener
  • Directly attaching the 'onmouseup', 'onmousedown', 'onclick' events inline on the Flash object
  • Switching from event 'bubbling' to event 'capturing' (only works in Firefox/Safari)

I need this to work in IE6+, Firefox 2+, and Safari 3+.

Thanks for any help! -Dave

A: 

Do you own the flash objects?

We implemented call-backs from Flash to JavaScript when flash detects clicks. But we own the flash app and can manage the interaction.

n8wrl
I forgot to mention, we do not own the Flash objects. We are trying to detect clicks that happen on display advertising.
A: 

Use the YAHOO yui.

If ( YAHOO.deconcept.SWFObjectUtil.getPlayerVersion().major == 0 ) { alert("error"); }

Diogo Fernandes