I need to add the following code into my Flash website design before internet uploading. It is Flash plug in detection code, which should check if viewer has the Flash plug-in installed or not.
But, I’m not sure where to put this code, in the 1st frame of my opening (index) movie perhaps? And, do I need to have this code in everypage (all movies) of my website? I have flash preloader in the 1st frame. Will the preloader work with this plug- in detection code in the same frame? Do I need to add the detection code in different frame?
I got this following code from kirupa.com tutorial
Ok, well from what I saw after taking a quick glance, it’s javascript code that doing the checking (from this source at least)
<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*)))
continue;
var MM_PluginVersion = words*;
}
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\>
'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next
');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))
');
document.write('</SCR' + 'IPT\>
');
}
if ( MM_FlashCanPlay ) {
window.location.replace("http://www.kirupa.com/flash.htm");
} else{
window.location.replace("http://www.kirupa.com/noflash.htm");
}
//-->
</SCRIPT>
Normally it’s good to place javascript functions like this into your header tag on an html page. So if your main flash movie sits in “index.html”, then inside that, go through the tags until you get to
<head> and </head>
and place it there. Make sure you follow through to change all the things you need to change like it mentions to do in the tutorial.
I have provided several variations of the Flash Detection script for you to use on your own site. To use these scripts, simply copy and paste the code into an HTML document. Usually the HTML document will be the first page that leads up to some Flash content such as an index.htm or flashdetect.htm page.