查看文章 |
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. |
最近读者: