javascript onclick event over flash object

I found this at http://progproblems.blogspot.com/2009/08/javascript-onclick-for-flash-embeded.html

  1. Set the param wmode to transparent. This allows the object containing the flash to receive the javascript onclick.
  2. Use onmousedown insted of onclick. In spite of using wmode transparent, some browsers still wont call the onclick, but they do call onmousedown.

The code looks like this:

<div onmousedown="clickBanner(1)">
<object>
<param name="movie" value="https://stackoverflow.com/questions/1444562/3.swf">
<param name="wmode" value="transparent" />
<embed wmode=transparent allowfullscreen="true" allowscriptaccess="always" src="https://stackoverflow.com/questions/1444562/3.swf"></embed>
</object>
</div>

It work for my needs =)

Leave a Comment