Flash with image fallback?

Discussion in 'Web Design and Development' started by big_malk, Apr 29, 2009.

  1. big_malk macrumors 6502a

    Joined:
    Aug 7, 2005
    Location:
    Scotland
    #1
    I am working on a site for a client, and have been asked to change the Google ads to a flash banner, that falls back to a gif if the browser isn't using Flash.
    I expected to do a two second Google search and find some JS code to do this across all browsers, but I can't seem to find anything like this.

    I don't want to spend all day debugging JS on every browser when this seems like such an obvious thing to already be out there, somewhere. Does anyone know where I can get some open source code to do this?

    Thanks
     
  2. design-is macrumors 65816

    design-is

    Joined:
    Oct 17, 2007
    Location:
    London / U.K.
    #2
    Not sure about Google ad stuff... but to get an image when flash isn't available, you can use this piece of code:

    Code:
    <object type="application/x-shockwave-flash
    data="yourmovie.swf" 
    width="400" height="300">
    <param name="movie" 
    value="yourmovie.swf" />
    <img src="noflash.gif" 
    width="200" height="100" alt="" />
    </object>
    
    Insert your own path to your swf, the height and width of your swf and path to the image to use instead.

    I found it when looking for a way to validate a page with flash on it. Source: A List Apart.
     
  3. big_malk thread starter macrumors 6502a

    Joined:
    Aug 7, 2005
    Location:
    Scotland
    #3
    Thanks, that’s exactly what I needed!
    I guess I was looking for an overcomplicated solution, with JS to test for Flash etc.
    Do you know if this works across all major browsers?
     
  4. design-is macrumors 65816

    design-is

    Joined:
    Oct 17, 2007
    Location:
    London / U.K.
    #4
    Excellent, glad it's what you were after - wasn't sure if it would be suitable as you mentioned google ads and I'm not overly familiar with their format.

    This method should be fine for all common browsers.

    Let us know if you have any problems :)

    /Doug
     

Share This Page