Code to make JPEG banner appear in place of flash

Discussion in 'HTML & Website Design' started by TheDebacler, May 24, 2006.

  1. #1
    I want a JPEG banner to appear in place of a flash video on the head banner of a site of mine on computers that don't have flash installed. How do I do this? Can I do it with HTML or do I need a javascript file?
     
    TheDebacler, May 24, 2006 IP
  2. johniman7

    johniman7 Peon

    Messages:
    245
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    As far as I know this would require javascript to determine the browser and or wether or not they have flash.
     
    johniman7, May 24, 2006 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    That's exactly what the object element is meant to do. Unfortunately IE does not support html4 very well. You might try it anyway.
    
    <object type="application/x-shockwave-flash"
            data="some.swf">
      <img src="flashreplacement.jpg" alt="whatever the pic's about">
      <p>This sentence is here because your browser did not load either
         the Flash movie I had for you nor the image I planned as backup</p>
    </object>
    Code (markup):
    If the Flash doesn't load, the jpeg will be the next option. Should images not be supported, then the <p> will be rendered. All in all a very accessible fail through.

    cheers,

    gary
     
    kk5st, May 24, 2006 IP
  4. ramakrishna p

    ramakrishna p Notable Member

    Messages:
    1,798
    Likes Received:
    361
    Best Answers:
    0
    Trophy Points:
    240
    #4
    Similar question has been answered at http://forums.digitalpoint.com/showthread.php?t=87726
     
    ramakrishna p, May 24, 2006 IP
  5. TheDebacler

    TheDebacler Banned

    Messages:
    73
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Just so I get this right, my HTML for the embedded flash file is:

    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0"
    id="Movie1"
    width="635" height="150"
    >
    <param name="movie" value="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/images/header1.swf">
    <param name="bgcolor" value="#000000">
    <param name="quality" value="high">
    <param name="allowscriptaccess" value="samedomain">
    <embed
    type="application/x-shockwave-flash"
    pluginspage="http://www.macromedia.com/go/getflashplayer"
    name="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/images/header1.swf"
    width="635" height="150"
    src="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/images/header1.swf"
    bgcolor="#000000"
    quality="high"
    swliveconnect="true"
    allowscriptaccess="samedomain"
    >
    <noembed>
    </noembed>
    </embed>
    </object>

    Do I insert the your code after the </object> tag or right before it?
     
    TheDebacler, May 24, 2006 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    Right after the embed and before the </object>. The <embed> element is an example of failthrough just like the image and then the text in my example.

    You would do well to make your markup valid html. The invalid method with object is why Moz browsers have to use the embed element, which is itself non-valid. ALA has an article on valid markup for flash.

    cheers,

    gary
     
    kk5st, May 24, 2006 IP
  7. TheDebacler

    TheDebacler Banned

    Messages:
    73
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thank you. One more question. Is the only way to check if the code works to ununistall flash and see what happens, or is there an alternative?
     
    TheDebacler, May 25, 2006 IP
  8. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #8
    I don't know of one. I wish the Firefox Flashblock extension acted as if Flash didn't exist. I've just used Lynx to check the failthrough. Got an old machine sitting around? :)

    cheers,

    gary
     
    kk5st, May 25, 2006 IP