SWF not showing using swfobject

Wasn’t sure where to put this, so…

I’ve got a page that I created using the swfobject generator:


This is the generated code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
        var flashvars = {};
        var params = {};
        params.play = "true";
        params.loop = "true";
        params.menu = "false";
        params.quality = "high";
        params.scale = "showall";
        params.wmode = "window";
        params.devicefont = "false";
        var attributes = {};
        swfobject.embedSWF("SOS.swf", "myAlternativeContent", "100%", "100%", "9.0.0", false, flashvars, params, attributes);
    <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" />

For some reason the audio plays, but the flash doesn’t at all in Firefox and shows up tiny in Chrome, tho’ it works fine in Safari. It does work correctly when the Flash-generated code is used:


Can anyone give me any pointers as to what would cause this? I tried making the flash version 8.0.0 but then only the alternative content showed.

(I should point out that the Flash came from a designer - I don’t do Flash at all and am only creating the alternative content and putting it online, which might explain why I’m utterly clueless.)

I’m not sure why this is the case, but it’s actually a CSS issue that’s causing your SWF to not show up in Firefox. I made a test page of your SWFObject code and noticed that the index.html version has this line of CSS:

html, body { height:100%; background-color: #ffffff;}

Adding height: 100% to html and body fixed my local copy. The SWF loads in Firefox 13.0.1, Chrome 21.0.1180.60 and IE9 for me.


Well, since it’s just a holding page, I just put it up with the Flash-generated code but it’s good to know for next time!

Thanks very much!