This is usually solved by programming the event on the flash object, but in this case I am not able to modify the object, because the user can upload new flash objects which I cannot control.
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:
<param name="movie" value="3.swf">
<param name="wmode" value="transparent" />
<embed wmode=transparent allowfullscreen="true" allowscriptaccess="always" src="3.swf"></embed>
Note that wmode has to be set in two different ways, because Firefox and IE have different syntax.
Tested on: IE 7, Firefox 3.5 and Chrome.