SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2012
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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:

    http://lisadearaujo.com/clientaccess/TNC/index.html

    This is the generated code:

    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">
    <head>
        <title></title>
        <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);
        </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>
    </body>
    </html>
    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:

    http://lisadearaujo.com/clientaccess/TNC/SOS.html

    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.)

  2. #2
    SitePoint Zealot imouto's Avatar
    Join Date
    Sep 2004
    Location
    Gotham
    Posts
    184
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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.

  3. #3
    SitePoint Member
    Join Date
    May 2012
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bizarre.

    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!


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •