Display IMG when flash doesn't work?

Discussion in 'HTML & Website Design' started by kyoku2, Jul 20, 2007.

  1. #1
    Hi there I would like to find a code that displays IMG when the browser doesn't support flash. Thanks!
     
    kyoku2, Jul 20, 2007 IP
  2. kyoku2

    kyoku2 Peon

    Messages:
    322
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    sorry i tried google but couldnt find any info on it. Someone must know!
     
    kyoku2, Jul 20, 2007 IP
  3. mgware

    mgware Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I think that is something like this (i don't test it):

    <script language="javascript">
    <!--
    // detect Flash plugin
    if (navigator.plugins["Shockwave Flash"])
    {
    // if Flash is installed
    document.write('<embed src="flashApplication.swf" />');
    }
    else
    {
    // if Flash isn't installed
    document.write('<img src="Image URL" alt="Alternative Image" />');
    }
    -->
    </script>

    Tell me if it doesn't work.
    Bye!
     
    mgware, Jul 21, 2007 IP
  4. kyoku2

    kyoku2 Peon

    Messages:
    322
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That works thanks.
     
    kyoku2, Jul 21, 2007 IP
  5. jawanda

    jawanda Peon

    Messages:
    151
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hey that works but you should really take it to the next level and use SWFobject. http://blog.deconcept.com/swfobject/

    It is a really simple to use javascript that, amongst other things, allows you stick your alternate non-flash content in a <div> that is only displayed if the user doesn't have flash. But it does much more than that, it also gets rid of the stupid "Click to activate" thing in IE, allows super easy inline upgrade to the latest version of flash, and more... just checkout the site. I had been developing flash for years before I found swfobject and wish that I had known about it all along.

    And, of course, it is free.

    -P
     
    jawanda, Jul 21, 2007 IP
  6. kyoku2

    kyoku2 Peon

    Messages:
    322
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    hi there the first script doesnt show swf in IE..
     
    kyoku2, Jul 21, 2007 IP
  7. kyoku2

    kyoku2 Peon

    Messages:
    322
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    jawanda, the script seems to be neat. I wonder how I can dispaly an image when flash can't display for whatever reason? what's the code?
     
    kyoku2, Jul 21, 2007 IP
  8. kyoku2

    kyoku2 Peon

    Messages:
    322
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    cheers. got it working lol.
     
    kyoku2, Jul 21, 2007 IP