Son of Suckerfish and Flash

So, you’ve implemented the Son of Suckerfish dropdown menu on your cool new site design. And it just so happens that you have an awesome little piece of Flash on the site - something to add to the look in a small way without looking like a cheesy animated GIF. It’s in a nice spot, right below your new dropdown menu.

But, hold the phone! You’ve now discovered that the dropdowns fall behind the Flash object. You double-check your CSS, and you’ve got the Flash object set with a z-index of 0, and the dropdowns at 1000 - but the dropdown is still falling behind the Flash.

What gives?

Well, here’s the thing. Since Flash is so often used within websites, people start thinking that it’s a part of (X)HTML, and/or it’s something that works within the same parameters of (X)HTML. Almost like it’s a part of the spec or something.

It’s not.

Flash is something that exists outside of the scope of the DOM. It’s not a part of (X)HTML at all. Think of it like this: You have a piece of paper, and you draw a nice picture on it with pencil. Then you cut a picture of an orange out of a magazine and tape it to the paper. It’s not really a part of the drawing, until you tape it on there, and once it’s on, it covers the drawing.

Flash is like that - it’s an external object that needs to be embedded in the page, and it needs certain coding so the browser can make it work.

With that in mind, how do you get some of your drawing to show up over the photo?

You must set the background of the Flash object to be transparent. In two places. Add this line to your object/embed code within your (X)HTML file:

<param name=”wmode” value=”transparent”>

…and in the line that starts out <embed src=”…>, you must add ‘wmode=”transparent”‘.

That should do it for ya!

Comments

Jake says...
1

I tried your concept for a flash movie under my menu (Town of LaSalle button) and it worked. One problem however is that the following pops up when attempting to click on the drop down menu.

Click to activate and use this control.

Any ideas on how to work around this. I tried saving the site as an xhtml thinking this would make a difference but it didn’t.

lokin says...
2

Hi Shelly!

Thank you so much for explaining this! lol, I even tried everything that you mentioned before I found your post. However, after adding the code as instructed, its still not working for me. :[ The flash player is still floating above my son of suckerfish drop downs. Have any ideas or suggestions??!

Thanks in advance!
:D

lokin says...
3

AHH-HA! I found it.

I looked back through the code and found a reference to the wmode in the javascript bit “AC_FL_RunContent” that sade it was equal to window. I quickly changed it to transparant and viola! no more sticker float! Hope you dont mind if I paste that specific part here for others?!
In the js that starts

if (AC_FL_RunContent == 0)

look for and replace;

‘wmode’, ‘window’,

with the following!

‘wmode’, ‘transparent’,

Cheers!

admin says...
4

Sorry Jake! I didn’t see your comment there -

You must be viewing in IE6. That’s a result of the Eolas lawsuit that Microsoft lost. You want to google “FlashObject” or “SWFObject” javascript to get around that issue.

jason_sot says...
5

works great in FF but I cant seem to make it work in IE7. Any ideas on how to make it work there as well?

Justin O'C says...
6

Thanks so much. This is something that I’ve been looking at on my list of things to do and I have just been avoiding it figuring it would be a total pain. Not so. Great tip.

Thanks much!!!!

Trackbacks & Pingbacks

Leave a Reply