//
// First : Detect ActiveX control
//
Function VBGetFlashVer(fVer)
on error resume next
Dim sFlashControl, sFlashVersion
sFlashVersion = "0.0"
set sFlashControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(fVer))
if (IsObject(sFlashControl)) then
sFlashVersion = CStr(fVer)
sFlashVersion = CStr(sFlashControl.FlashVersion(""))
end if
VBGetFlashVer = sFlashVersion
End Function
// -->
</script>
<script language="javascript">
<!--
/**
* Second : buildup the detector
*/
var iStepValue = 10; // Iteration cycles - ref : fTheMinVersion plus this value
var fTheMinVersion = 3; // Minimum 'Required' Flash verson.
var sTheMaxVersion = (parseInt(iStepValue + fTheMinVersion)); // Maximum loop - counter
var bIsMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
var bIE4plus = (document.all) ? true : false;
var bNN4plus = (document.layers) ? true : false;
var bPlugin = false;
var bWin = (navigator.platform.toLowerCase().indexOf("win") != -1) ? true : false;
var oTheMovie = "", sVB = "", sIsActiveX = "", sNoFlash = "", sPluginDescription = "";
function flashDetectAxVer(reqVer) {
if (bIE4plus && bWin) {
for (var i = sTheMaxVersion; i >= 0; i--) { // loop backwards through the major version values
for (var h = 0; h < 10; h++){ // loop forward through the minor version values
versionString = VBGetFlashVer(parseFloat( i + "." + h ))
if (versionString != "0.0") {
// if we get 1.0 we assume it is actually 6.0
versionNum = (versionString == "1.0" ? 6.0 : parseFloat(versionString))
return (reqVer ? ((fTheMinVersion >= versionNum ) ? true : false) : versionNum)
}
}
}
}
return (reqVer ? false : 0.0);
}
/**
* Third : check for plugins
*/
if (navigator.mimeTypes
&& navigator.mimeTypes["application/x-shockwave-flash"]
&& navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
// show the app name and plug-in version
sPluginDescription = "<ul>" + navigator.appName + " plug-in : " + navigator.plugins["Shockwave Flash"].description + "</ul>";
}
// Browser uses ActiveX Control - test; can we create the obj ? true:false
else if (bIE4plus && !bIsMac){
var sFlashControl = flashDetectAxVer(fTheMinVersion);
if (sFlashControl && (parseFloat(versionString) >= fTheMinVersion)){
}
// Flash compability is limited or nonexistant - so let's provide an exit with a Flash upload option.
// This is generally where you might place a 'document.replace(theReplacementFile) command.'
sNoFlash += '<div><font class="clrWhite">Movie does not support version ';
sNoFlash += '<font class="clrRed">' + fTheMinVersion + '</font> of Flash player</font></div>';
sNoFlash += '<img src="http://www.3dasa.com/products/soniccruiser/movie_stars/sc10070.jpg">';
sNoFlash += '<div><a href="http://www.macromedia.com/shockwave/download/';
sNoFlash += 'index.cgi?P1_Prod_Version=ShockwaveFlash" class="clrWhite">Get Flash : ';
sNoFlash += '<img src="../images/go_btn.gif" border="0"></a></div>';
document.write( sNoFlash );
}
}
//-->
</script>
----------------------------------------------------------------------------------
Finally : call our JavaScript function to make it happen.
place this on the web page where you want your movie to be.
<!-- Check for and load Flash movie - if possible -->
<script language="javascript">doFlashValidation()</script>
----------------------------------------------------------------------------------