Hi,
I need to know how to detect if flash is installed regardless of the browswer the end user is using so that the website can automatically determine whether to load the flash version of the website or a the non flash version, is this possible, if so how ?
Thanks
Hey.
Get to work! :-)
Here's some code:
<SCRIPT LANGUAGE=JavaScript1.1>
<!--
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins["Shockwave Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
&& (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFla sh." & MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}
if ( MM_FlashCanPlay ) {
window.location.replace("http://www.kirupa.com/flash.htm");
} else{
window.location.replace("http://www.kirupa.com/noflash.htm");
}
//-->
</SCRIPT>
Chew on that for a time...
Paul
Of course, I just remembered that Macromedia put out a Flash Detection Kit that you can download etc. You can find it here:
http://www.macromedia.com/software/f...detection_kit/
Happy surfing!
Paul
That script will be useful for when it comes time to re create the kingswood website![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)