PDA

View Full Version : How to Check for Flash Plugin?




triton
Feb 10, 2006, 01:03 PM
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!! :)



Anonymous Freak
Feb 10, 2006, 01:18 PM
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!! :)

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

Mitthrawnuruodo
Feb 10, 2006, 01:23 PM
Something like this should work:

<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 (http://validator.w3.org/), 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:

<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... :)

londonweb
Feb 10, 2006, 05:02 PM
This link on the macromedia website helped me out.

http://www.macromedia.com/software/flashplayer/download/detection_kit/

rozwell
Feb 10, 2006, 08:42 PM
you can actually use flash to detect flash in version 5 or higher... so thats an option too.