PDA

View Full Version : Flash and z-index


dean80
03-24-2003, 04:51 PM
Hi all. I think I saw this somewhere in a previous thread about how MacroMedia Flash does not respond to z-index attributes and thus will always be on top of anything else on the page. Is this true, and if so, is there a work-around for it?

Thanks!

justame
03-24-2003, 04:59 PM
dea...
did youuu just a mean® this one???
http://www.codingforums.com/showthread.php?s=&threadid=16890&highlight=flash

Cherubae
03-24-2003, 05:01 PM
I experienced the same thing a few days ago ;) What I did was incorporate the image I wanted the Flash file to be underneath *into* the movie on the top-most layer, then added a keyframe on that layer all the way to the end of the movie. That way the image stayed in the same place the entire time. After that, I positioned the flash movie using "style=margin-left:210px" so the top-layer image was in the exact same spot as where it would of been if the Flash wasn't even there.

example -> http://www.fogu.com/hm4/test.php

The tree top is only a static image for about 210 pixils. After that, the rest of it (the orange guy in the leaves) is all done in Flash. Flash compression makes that portion of the tree top a *little* blurry, but anyone I've talked to said that they don't notice it.

dean80
03-24-2003, 05:07 PM
Justame, yeah, pretty much same problem as what was in that thread. I have a horizontal menu at the top of the page and a Flash animation just below it. Any of my menu items for each button are covered up by the Flash animation, despite using using a z-index of -3 to try to put the Flash below the menu.

Cherubae, I see what you're talking about with your site. But I've also noticed that your menu is not overlapping your Flash animation. That's a great work-around for your drifting clouds though!

Cherubae
03-24-2003, 05:27 PM
Okey so my problem wasn't exactly the same thing like I thought :D

Do you just need to push your flash movie farther down the page or are your buttons sort of a dhtml drop-down menu (whereas the flash would always be on top)?

dean80
03-24-2003, 05:38 PM
Cherubae, yeah, my buttons are in a DHTML drop-down menu and the menu items are hidden underneath the Flash banner. All I need is to have the menu always be on top of everything, including the Flash banner.

Cherubae
03-24-2003, 06:04 PM
Golly, I don't know then :confused: The Flash is always going to sit on top no matter what you do. The only thing I can think of is to move the Flash above the navigation buttons or make the buttons themselves into the Flash animation.

<wacky brainstorm mode ON>
Could one put the Flash inside of an i-frame and then z-index that i-frame to the back? Or some sort of image swap whereas on mouseover the Flash would go away and change into a a static jpg?
</wacky brainstorm>

brothercake
03-24-2003, 07:12 PM
http://www.macromedia.com/support/flash/ts/documents/wmode.htm - apparently if you use the 'wmode' transparency attribute in the flash object, this makes it fall-in with the standard page z-order.

dean80
03-24-2003, 07:25 PM
Hey B-Cake!!! VERY NICE! It works now. I really appreciate the help. Now the design doesn't have to be redone.

Thanks again!

justame
03-25-2003, 12:10 AM
Originally posted by brothercake
http://www.macromedia.com/support/flash/ts/documents/wmode.htm

bro...
just a ta® for the just a solution® ...:O)))

Spookster
03-25-2003, 02:31 AM
:thumbsup:

That is very good info. I wish I had known how to do that before I had to rearrange some things in a site I was working on. Maybe the mod would like to make this a sticky important thread for awhile. Or maybe WA could publish this tip at javascriptkit under the web tutorials section.

dean80
04-03-2003, 05:38 PM
I've noticed that in Netscape 7 this problem is still occuring, despite using the wmode attribute. Is this just a fatal flaw of Netscape or is there a work-around?