0
votes

I have the following code to display the swf object on the page. It works well in all browsers. However, if shockwave flash turned off in Firefox, it won't fallback into image and show bunch of characters instead looking like "CWS q�x��wX�Y�7z�..." All other browsers fallback to the image. I verified that we serve application/x-shockwave-flash MIME type on our server.

<script type="text/javascript">
swfobject.registerObject("fd_flash","8.0.0");
</script>
<div>
<object height="376" id="fd_flash" width="940">
<param name="movie" value="path/file.swf" />
<param name="wmode" value="opaque" />
<!--[if !IE]>-->
<object data="path/file.swf" height="376" type="application/x-shockwave-flash" width="940">
<!--<![endif]-->
<div><img src="path/image.jpg" /></div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>

Thank you!

1
Can you link to the page in question? It really sounds like a MIME type issue, even if you said you checked it already....Boris Zbarsky
It is a main page banner on www.jiwire.comSasha Kastsiushkin
That would be jiwire.com/sites/default/files/JiWire-FD-Jan2012-a.swf which the site sends as text/plain as far as I can tell. Certainly when I get that url with wget the HTTP headers include Content-Type: text/plain.Boris Zbarsky
Hmm, yes you are right. However, I downloaded this swf file from our staging server and it also has text/plain header, however Firefox gracefully fallback into image there.Sasha Kastsiushkin
Hard to say what you staging server is doing without having access to it...Boris Zbarsky

1 Answers

0
votes

You could try another way of using swfobject. Add a link in your <head> to your swfobject.js file, then in your <body> put this:

<div id="yourFlashDiv">
    <!-- ALTERNATE CONTENT GOES HERE -->
    <p>This paragraph will show if your Flash content won't</p>

    <!-- FLASH CONTENT GOES HERE -->
    <script type="text/javascript">
      // <![CDATA[
      var so = new SWFObject("path/file.swf", "SwfTitleGoesHere", "376", "940", "8", "#FFFFFF");
      so.addParam("wmode", "opaque");
      so.write("yourFlashDiv");
      // ]]>
    </script>
</div>

This is what I've used for swf display, and it has failed gracefully on every browser I've tested. Hope this helps