Transparency of a SWF with wmode=Transparent does not work in Firefox

Asked

Viewed 82 times

1

I need to display a SWF with transparency. O <wmode = transparent> is working on all browsers except Firefox. What?

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="100%" id="root" align="middle">
<param name="movie" value="root.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#666" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="transparent">          
<param name="scale" value="showall" />
<param name="menu" value="false" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--[if !IE]>-->
  • Actually, your question has a problem because you do not show the full code. The above example is invalid.

3 answers

1

If you use the Swfobject, You’ll probably get rid of that problem. It is the recommended way to insert Flash objects into HTML, and is required if you want SWF and Javascript to be able to pass information back and forth. Has a embed code generator on the project website.

<html>
<head>
    <title>Usando SWFObject</title>
    <style>
        body {background-color:#c00;}
    </style>
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
    <script type="text/javascript">
        // Embed normal
        var flashvars = {};
        var params = {};
        params.quality = "best";
        params.wmode = "transparent";
        var attributes = {};
        swfobject.embedSWF("SEU-SWF.swf", "myAlternativeContent", "800", "600", "9.0.0", false, flashvars, params, attributes);

        // Embed de YouTube
        // https://developers.google.com/youtube/js_api_reference#Embedding
        var yt_params = { allowScriptAccess: "always" };
        var yt_atts = { id: "myytplayer" };
        swfobject.embedSWF(
            "http://www.youtube.com/v/aZMbTFNp4wI?enablejsapi=1&playerapiid=ytplayer&version=3",
            "ytapiplayer", 
            "425", 
            "356", 
            "8", 
            null, 
            null, 
            yt_params, 
            yt_atts
        );            
    </script>
</head>
<body>
    <div id="myAlternativeContent">
            <a href="http://www.adobe.com/go/getflashplayer">
                <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
            </a>
    </div>
  <div id="ytapiplayer">
    You need Flash player 8+ and JavaScript enabled to view this video.
  </div>
</body>
</html>

Jsfiddle

  • very good @brasofilo

0

You could try

<param name="wmode" value="opaque" />

instead of:

<param name="wmode" value="transparent" />

From what I read you both have a similar function and can solve your problem.

  • Vlw by the hint little brother, but unfortunately it didn’t work :(

0

I managed to solve the problem: all I had to do was create a <!--[if !IE]>--> and re-specify the vmode for transparent.

  • 1

    vmode not wmode right ?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.