Tuesday, March 18, 2008

YUI overlays on Flash under Firefox/Linux

I recently ran into a known problem of not being able to overlay DHTML on top of a Flash object in a web page. This problem was fixed in the flash player by the introduction of the window mode (wmode) which is described in detail here. The fix involves changes to both the flash player and the browser. However, this fix is currently not available in firefox on linux - the environment I am currently using and the one I need to support.

One of the ways to work around this is by placing the div on top of an iframe in the z-index order and keeping z-index of the iframe positive. This is illustrated in this example here. Use view source to take a look at the source.

The same idea and concept has been implemented nicely in YUI toolkit's Overlay widget.

This example does not work properly in firefox on Linux when there is a flash movie under the calendar widget (when the button is clicked, the calendar does not overlay on top of the movie but goes under the movie instead).

I was able to add the following methods in the YAHOO.util.Event.onDOMReady method of this example (after the call to calendar.rende()) to fix this issue
oCalendarMenu.cfg.setProperty("iframe", true);
oCalendarMenu.cfg.setProperty("zIndex", 10);
oCalendarMenu.stackIframe();
oCalendarMenu.showIframe();

These methods (plus more) essentially let one control the iframe that is dynamically created inside the overlay widget at any specified z-index.
Sweet!

13 comments:

Anonymous said...

Rajeev . I am stuck in the same problem. Looking at you blog, it looks this is fixed. I tried the example given in your blog on Fireofx2.0 but the problem is still there. Can you you help me on this. My email id is gaurav.misra@sun.com

Rajeev said...

This does work for me in this environment:
- Ubuntu 7.10
- Mozilla Firefox 2.0.0.11
- Flash Player 9,0,124,0
- YUI 2.5.0

I can help you debug it, but please post your exact problem and your code etc. here so that the other readers can benefit from this debugging as well. Thanks.

Rajeev

rybaxs said...

its a bug at the adobe.com website.. for linux browser only.

Anonymous said...

Wow, thank you Rajeev. I've been banging my head against this problem for two days now, and the solution existed in the YUI library all along. :)

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

Nice fill someone in on and this post helped me alot in my college assignement. Thanks you on your information.

Anonymous said...

rajeevtipnis.blogspot.com; You saved my day again.

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

Very nicce!

Anonymous said...

Hi,

I begin on internet with a directory

Anonymous said...

45834.....11455