1

I have a .swf-to-Swiffy HTML5 banner and would like to create a .swf fallback for IE. What is the proper way to do this? I currently have the Swiffy inside an iframe (yikes).

Zenexer
  • 18,788
  • 9
  • 71
  • 77
Jessica
  • 11
  • 1
  • 3
  • Check the user agent, if IE then write a Flash object, otherwise write that Swiffy iframe. – Muhammad Abrar Feb 10 '12 at 00:36
  • I added the `html` and `flash` tags to your question. Since these tags are a bit more general, they should give your question more attention. – Zenexer Feb 10 '12 at 00:36

1 Answers1

1

There is a blog post here that may help http://www.malphursinteractive.com/flash-to-html5-fallback/

Essentially the idea is to use CSS conditionals to load the relevant javascript depending on the browser e.g.

    <!--[if !IE]> -->
        <script type="text/javascript" src="javascripts/swiffy.js"></script> 
        <script type="text/javascript" src="javascripts/animation.js"></script>
    <!-- <![endif]-->

    <!--[if IE]>
        <script type="text/javascript" src="javascripts/swfobject.js"></script>
        <script type="text/javascript">
            swfobject.embedSWF("images/animation.swf", "swiffycontainer", "300", "390", "9.0.115");
        </script>
    <![endif]-->

The 'swiffy.js' is the Google Swiffy library, the 'animation.js' contains the specific animation javascript created by exporting Flash to Swiffy. These are loaded for NON IE browsers.

The 'swfobject.js' is loaded and embed code is run for IE browsers to display a Flash fallback.

You then have a div in your page to hold the animation and target it with the 'swfobject.embedSWF' code.

<div id="swiffycontainer"></div>

You can also provide a Non flash fallback with CSS e.g.

#swiffycontainer{
 width: 300px;
 height: 390px;
 background: url('../images/animation.gif') no-repeat no-repeat;
 background-position: center center;

}

Hope that helps.

r8n5n
  • 2,059
  • 17
  • 23
  • Link rot happens. Please sum up or quote the crucial bits here. Link-only answers are subject to deletion without further notice. – ЯegDwight Sep 04 '12 at 10:45