javascript onclick event over flash object

2019-01-03 15:17发布

I have one embed flash movie inside one div, I put one javascript onclick event handler in the main div, but isn't catching the click, what is wrong?

Code:

   <div id="top-box-player" onclick="alert('Hi Bananas!');">
     <object width="400" height="300">
        <param name="movie" value="general.swf">
        <embed src="./swf/general.swf" width="400" height="300">
        </embed>
     </object>
   </div>

8条回答
不美不萌又怎样
2楼-- · 2019-01-03 15:46
<param name="wmode" value="transparent" />

This was the solution for me. Well, I implemented it over the AC_RunActiveContent.js at the params:

'wmode', 'transparent',

Nice!!!

查看更多
Viruses.
3楼-- · 2019-01-03 15:46

I had that problem when I tried to make automated dynamic-placed banners. If SWF were setted to 'opaquecolor' mode, then I had no clicks acceptables - and i had to use opaquecolor because some banners were messed up with the websites colors. The solution I found, is to set the SWF to 'transparent' mode, at a <div> of z-index:10, and place beneath it a new <div> of same dimensions of the SWF file, filled with the opaquecolor of the SWF. Both divs into an <a> tag. That worked.

Example:
    <a href="www.mysite.com">
    <div id="SWF_file_container" style="width:100px; height:40px; z-index:10;">
    <object> .... </object> (adding SWF in TRANSPARENT MODE)
    </div>
    <div id="opaquecolor_of_swf" style="width:100px; height:40px; z-index:2; background-color:#ff0000;"></div>
    </a>
查看更多
登录 后发表回答