views:

212

answers:

4

I am facing a tricky situation here...this is the problem...
I have a flash object over which i want to display an image
These are the tricks that i tried...
1.Playing with z-index(no use)
2.Setting the wmode parameter to transparent/opaque(again no use)
3.Using javascript and displaying image only after the page is loaded(still no use)
I tried googling but found no solutions..:(
Thanks in advance

Update-the code i am using

        <div style="position:absolute; top:0px; z-index:-2000;">
            <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="176" height="146">
                <param name="movie" value="/Images/WordOfLife.swf" />
                <param name="wmode" value="transparent" />
                <param name="quality" value="High" />
                <param name="menu" value="false" />
                <embed src="/Images/WordOfLife.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" menu="false" width="176" height="146" />
            </object>
        </div>
        <div style="position:absolute; top:0px; z-index:2000;">
            <img src="Logo.gif" alt="" />
        </div>

also tried with value="opaque"
have done all possible suggestions...pls help..

A: 

When you use the z-index, make sure the CSS position of both (the img and the flash object) is set to relative or absolute:

.imgAboveFlash {
    position: relative;
    z-index: 10; /* higher than that of flash object */
}

And set the wmode of the flash object to opaque.

Make sure that the parent html element has its position set to relative.

davydepauw
both are absolutely positioned elements...
ZX12R
In combination with the transparent/opaque wmode?
davydepauw
no...tried them separately...
ZX12R
You should do it at same time, and you'll have the most success using the opaque wmode.
davydepauw
tried it...still no signs of change..:(
ZX12R
And setting the width and the height of the absolutely positioned elements? And in which browser are you testing it?
davydepauw
testing in firefox and ie... yes am right now testing with just a div rather than an image...the div has specific width and height..
ZX12R
A: 

I did a HTML menu dropdown purely in CSS and the Flash objects was always on top of every dropdown.

So, here's what I did. Make the Flash wmode to opaque.

For your case, make the flash object wmode to opaque and give an image a z-index higher than a flash object's z-index (try 1000 to "guarantee" higher position).

The Elite Gentleman
tried it...still no hope of changes..:(
ZX12R
+1  A: 

I'm guessing your code works fine in IE, but not in FF - add a wmode param to your embed as well:

<embed 
    src="/Images/WordOfLife.swf" 
    pluginspage="http://www.macromedia.com/go/getflashplayer" 
    type="application/x-shockwave-flash" 
    name="obj1" 
    menu="false" 
    width="176" 
    height="146"  
    embed="transparent"
/>
K Prime
am not sure if i understood you completely..but when i tried the above it doesn't work at all...the flash object is not displayed..!!
ZX12R
@ZX12R - I meant, just change the `embed` part of your code, and keep the `object` bits
K Prime
+1  A: 

Update: I knew it was either one or the other regarding wmode, I picked the wrong one. Shouldn't have answered a question suffering from sleep deprivation. I've checked it now and wmode set to transparent is what you want. It lets you put HTML elements above Flash objects.

Secondly, embed Flash the standards friendly way, and use swfobject.

Try layering a brightly coloured div over your Flash first for test. Also, perhaps move the image code above the Flash and see how that goes.

Finally, all that's needed to get your code to work, as mentioned above by K Prime, is setting wmode to transparent in your embed tag as well.

<div style="position:absolute; top:0px; z-index:-2000;">
    <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="176" height="146">
        <param name="movie" value="/Images/WordOfLife.swf" />
        <param name="wmode" value="transparent" />
        <param name="quality" value="High" />
        <param name="menu" value="false" />
        <embed src="/Images/WordOfLife.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" wmode="transparent" menu="false" width="176" height="146" />
    </object>   
</div>

<div style="position:absolute; top:0px; z-index:2000;">
    <img src="Logo.gif" alt="" />
</div>
Daniel Carvalho
thanks...will check it out.. am already tryin it with a div over flash..
ZX12R
wow...was very useful...but it doesn't work properly in firefox..:(
ZX12R
No, setting wmode to transparent won't force the Flash object to the top. To display images, or any HTML, in front of Flash Player you need to set wmode to opaque or transparent. wmode transparent will also show HTML behind empty parts of the Flash object, whereas opaque will show the background color of the Flash object, hiding anything behind the Flash object. Leaving out the wmode parameter (using the default wmode "window") will make the Flash Player take over rendering in that part of the screen, and the browser can't render anything else in that area (in most browsers).
Lars
Yes, I know how it works and what it does, I was just mistaken whether it did that in its default setting or transparent. Amended the answer so he doesn't get mislead. Thanks.
Daniel Carvalho
hey..thanks..:)
ZX12R