Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

triton

macrumors regular
Original poster
Jul 15, 2003
172
0
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

macrumors 603
Dec 12, 2002
5,561
1,252
Cascadia
triton said:
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

Moderator emeritus
Mar 10, 2004
14,424
1,065
Bergen, Norway
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... :)
 

rozwell

macrumors regular
Apr 17, 2004
242
1
you can actually use flash to detect flash in version 5 or higher... so thats an option too.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.