How to Check for Flash Plugin?

Discussion in 'Web Design and Development' started by triton, Feb 10, 2006.

  1. macrumors regular

    Joined:
    Jul 15, 2003
    #1
    Hi Everyone,

    I have a simple flash/shockwave animation. I was wondering what the code is that allows me to check the user first for the plugin, and redirects them or tells them that they need to download the plugin if they don't have it. And if they do have it, the code will allow the user to load the page.

    Any help is much appreciated.

    Thank you!! :)
     
  2. macrumors 601

    Anonymous Freak

    Joined:
    Dec 12, 2002
    Location:
    Cascadia
    #2
    Flash is included in all modern web browsers (and has been since at least 1998, by my recollection,) so don't worry about it.

    And even if they don't, all modern web browsers will offer to find the plugin if they don't have it. So don't worry about it.

    And if they have an old enough (or obscure enough) web browser to not support Flash, then it doesn't matter anyway, so don't worry about it. :-D
     
  3. Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #3
    Something like this should work:

    PHP:
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="550" height="400" id="show" align="middle">
    <
    param name="allowScriptAccess" value="sameDomain" />
    <
    param name="movie" value="/path/to/show.swf" />
    <
    param name="quality" value="high" />
    <
    param name="bgcolor" value="#ffffff" />
    <
    embed src="/path/to/show.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="show" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </
    object>
    I don't think it'll validate, but other than that it should work... ;)

    You need both the object and embed to make it work in both IE and Firefox, and it may like the whole path (ie. url) to the file better than just a relative path, but just try it out...

    Not sure you need all the param(eter)s either, try deleting some and see what happens... ;)

    Edit: If you want it to validate under xhtml 1.1, you may have to sacrifice the check and use something like:

    PHP:
    <object type="application/x-shockwave-flash" data="/path/to/file.swf" width="130" height="60">
    <
    param name="movie" value="/path/to/file.swf" />
    <
    img src="/path/to/alternative.gif" width="130" height="60" alt="whatever" />
    </
    object>
    But then you can have alternative code (where I've put the image) for those who don't hav flash or don't want flash contents showing (like me, who uses Safari with plug-in support disable and Adblock with Firefox). ;)

    Enjoy... :)
     
  4. macrumors 6502

    londonweb

    Joined:
    Sep 14, 2005
    Location:
    london
    #4
  5. macrumors regular

    Joined:
    Apr 17, 2004
    #5
    you can actually use flash to detect flash in version 5 or higher... so thats an option too.
     

Share This Page