SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2012
    Location
    US
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to show an image if flash is disabled?

    I have a new site for a client who wanted to keep his old flash gallery until I got him a new portfolio. I have it being pulled in through an iframe, but now he wants a static image to show so the infamous i-phone people don't get left with a blank box. I tried some code I found around the internet but it isn't working. Most of the posts are very old. I am not real familiar with .js so does anyone have a plug and play option or advice?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    If you use the <object> element to run the flash items, you can provide a fallback. E.g.

    Code:
    <object type="application/x-shockwave-flash" data="flash-file.swf" width="xxx" height="xxx"
            <param name="movie" value="flash-file.swf">
            <img src="path-to/fallback-image.jpg" alt="">
    </object>
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2012
    Location
    US
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried that but it still doesn't show... Im wondering if its how I have it set up. Thanks to you Ralph I am now able to set proper z-index which Is what I have going on here. The old site was just one html page with the flash embedded. It is behind the new Wordpress site I built have pulled in through iframe with a custom border, etc., all stacked. Is that whats interfering? I added the img src to the html file where the flash is like this..
    HTML Code:
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="detailexchangellc" align="middle" height="600" width="880">
    <param name="allowScriptAccess" value="sameDomain">
    <param name="movie" value="detailexchangellc2.swf"><param name="quality" value="high"><param name="bgcolor" value="#1E1E1E"><embed src="detailexchangellc2.swf" quality="high" bgcolor="#1E1E1E" name="detailexchangellc" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="center" height="600" width="880">
    <img src="http://detailexchangellc.com/altflash.jpg" width="650" height="477" alt="NoFlash" />
    the site is http://detailexchangellc.com

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Hm, odd, the image is there, but you have to scroll down to see it, which is weird. A blank box with a No flash message appears above it. I wonder if that message would disappear if those links to Flash were removed. Worth a try, anyway.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  5. #5
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,272
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    If the Flash is inside <object> tags, you can have a fallback child element inside <object>. Something like this is common:

    Code:
    <object id="someFlashThing" type="application/x-shockwave-flash" width="800" height="200">
      <param name="movie" value="theFile.swf">
      <p><a href="optional link to more portfolio images, if they exist"><img src="anImage.png" width="800" height="200" alt="Either what the image is showing, or if a link, where the link goes"></a></p>
    </object>
    Something like that is how the object element is supposed to work. You're using an iframe but I'm still assuming that inside the iframe is still an <object> tag (or possibly an <embed> tag, which I dunno if those can have fallback children).

    So, ideally this is something the browsers should do automagically for you, so long as you simply provide the image. This way, not just iThings but any other browser who happens to not have the Flash plugin will get an image.

    And then, as in my example, if there's something non-Flash you can link to that would be nice for folks.

  6. #6
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,088
    Mentioned
    256 Post(s)
    Tagged
    5 Thread(s)
    Threads merged to avoid further confusion.
    Take plenty of exercise walk round and round the garden
    or
    sign up now for the Isle of Jura 10K or Half Marathon!

  7. #7
    SitePoint Zealot
    Join Date
    Feb 2012
    Location
    US
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The second part was in an embed tag, after I switched it to object tag it worked, thanks guys!

  8. #8
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,272
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    arg, yes. I wondered how I could have missed ralph's answers! But I noticed when I answered my thread, it had been sitting in Javascript forums for a long time. Prolly why the OP started another thread.

  9. #9
    SitePoint Enthusiast Dreeass's Avatar
    Join Date
    Sep 2012
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would make it HTML5 if I were you so it works on all devices.

  10. #10
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Dreeass View Post
    I would make it HTML5 if I were you so it works on all devices.
    Ha ha, does HTML5 work in all devices? I think not ... unless you provide JS support or whatever.

    Feel free to post example, code.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."


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
  •