百度空间 | 百度首页 
 
查看文章
 
flash在iframe之上的bug
2008-11-26 16:21
最近的项目中,有个flash会在iframe上,在IE下会很正常的响应到注册的鼠标事件,但是在火狐中,如果flash漂浮在iframe框架页之上,就无法相应到任何鼠标事件。
google之后,发现这个bug居然已经存在了1年多,firefox2,flash8的时候被人提出,到现在flash10出来了,firefox升级到3.1版本,依旧没有解决。
相关bug描述:
firefox网站的
https://bugzilla.mozilla.org/show_bug.cgi?id=448567
adobe网站的
http://bugs.adobe.com/jira/browse/FP-289

一老外的所谓解决方案,当然没有什么实际价值,不过可以贴出来做个参考,也许别的地方能用到他这些思路。
That's one of several limitation of Flash on Firefox which is
acknowledged on various Adobe support pages. No doubt you're using Flash
with wmode=transparent or even wmode=opaque. You might not have noticed
yet, but things will be even worse in Safari. There are a few
workarounds, none of them are nice, but it beats serving Firefox with a
lesser experience.

One is to switch to wmode=window for Firefox. I imagine that you need
the transparency though, so we'll ignore that for now.

Another is to actively hide the iframe as you move over it. Each time
you move the DIV your Flash is on, look at all the iframe objects on the
page and just do some intersection math to determine if you're over it.
If you are, then you hide it. As you stop intersecting (or hide your
DIV) then you make it visible again. This can also be necessary if your
transparent flash finds itself over another flash object with
wmode=window, or if you move over a HTML select dropdown menu. All of
these things can bleed through your Flash, and they do it more on
Firefox and even more on Safari.

Another option is to create an iframe mask. You create an extra DIV
layer with the same position as the one your Flash is on, except this
has a z-index one lower than yours. On this new div you set the
background color to white and put an iframe tag on it with src="". This
iframe div will block the iframe that you're seeing bleed through your
Flash. Simply move this div as you move your own Flash div. It will
block out the nasty bleedthru objects that were bothering you. Of course
this itself is a big white rectangle, so can spoil your transparency
(although you never said you were running wmode=transparent, so it might
still be an option). Even if you are running in transparent mode, you
might be able to customize the size of this div (or have multiple divs)
so that your links aren't affected. I've tried creating a transparent
iframe mask but it doesn't work. The iframe masking only works when the
DIV is white, and it has an iframe tag on it.

A final option is to have an image object (using a fully transparent
GIF) which is on an extra DIV with a higher z-index than your Flash. It
can use the usemap tag of the IMG to catch clicks and do the appropriate
action.

Sorry if you want to follow up on any of these points, I'm just about to
unsubscribe from this newsgroup.


类别:脚本技术/javascript/flash | 添加到搜藏 | 浏览() | 评论 (4)
 
最近读者:
 
网友评论:
1
2008-11-27 00:31 | 回复
他们多牛啊,说暂不解决就不解决……
 
2
2008-11-27 18:54 | 回复
好长的英文啊, 博主最近好吗?
 
3
2009-02-05 16:15 | 回复
asdf
 
5
2009-06-30 12:36 | 回复
上面大概是说:
1.把swf弄成这种模式 wmode=window
2.动态隐显IFRAME来避免它对SWF影响
3.创建一个iframe蒙板层,外包一个DIV,移动FLASH时移动DIV。这个DIV要求白色背景才起作用(..不一定吧,可以白色然后设一个几乎看不到的透明值..)
4.用一个透明GIF图片放在最上面,然后再作事件适应?
 
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu