# Detection....an old question

**URL:** <https://forum.kirupa.com/t/detection-an-old-question/245926>\
**Category:** flash\
**Created:** [December 5, 2007, 3:19pm UTC](https://forum.kirupa.com/t/detection-an-old-question/245926 "2007-12-05T15:19:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![polyartist](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@polyartist](https://forum.kirupa.com/u/polyartist)\
**Post date:** [December 5, 2007, 3:19pm UTC](https://forum.kirupa.com/t/detection-an-old-question/245926/1 "2007-12-05T15:19:11Z")

</div>

Ey there guys,

I ran into an old post on detecting flash

```auto
<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>

```

Jscript isn’t my thing yet.  
But as I read the this script detects the version and sends you to the flashpage or sends you to a non-flash page.

Am I correct if I thought to have read that the script detects version 6?

```auto

var MM_contentVersion = 6;

```

Or does it detect six or lower?  
Is it possible for the script to detect 9 and lower?

Based on this script is it possible for the script to load a swf into a DIV (if detected) and otherwise to load an image into the same DIV.

```auto

if ( MM_FlashCanPlay ) {
 window.location.replace("http://www.kirupa.com/flash.htm");
[COLOR=red]//and then load SWF into DIV[/COLOR]
} else{
 window.location.replace("http://www.kirupa.com/noflash.htm");
[COLOR=red]//or load img into DIV on the same page instead of going to another page[/COLOR]
}

```

I know this is a lot though I feel it is possible yet have no idea on how I should accomplish this feat.  
Any help would be highly appreciated.

Kindest regards,

Polyartist
