# Flash 5 detection

**URL:** <https://forum.kirupa.com/t/flash-5-detection/28426>\
**Category:** flash\
**Created:** [August 13, 2003, 5:50pm UTC](https://forum.kirupa.com/t/flash-5-detection/28426 "2003-08-13T17:50:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickel](https://avatars.discourse-cdn.com/v4/letter/n/e9c0ed/32.png) [@nickel](https://forum.kirupa.com/u/nickel)\
**Post date:** [August 13, 2003, 5:50pm UTC](https://forum.kirupa.com/t/flash-5-detection/28426/1 "2003-08-13T17:50:51Z")

</div>

I’m following this tutorial here:

[http://www.actionscripts.org/tutorials/beginner/flash5\_plugin\_detection/index.shtml](http://www.actionscripts.org/tutorials/beginner/flash5_plugin_detection/index.shtml)

Problem is my file has a preloader on the 3rd frame (because the first 2 frames are the detection code) and my swf just stalls…so my question is does a preloader have to be in the first frame of a file to work? I tried putting the detection in another scene ahead of the preloader one and it still doesn’t work…Any ideas?

I’ve already tried macromedia’s detection kit and that won’t work either - just goes to my upgrage page even tho i have the proper plug in…heard there was a bug in it for Mac…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 14, 2003, 10:45am UTC](https://forum.kirupa.com/t/flash-5-detection/28426/2 "2003-08-14T10:45:20Z")

</div>

Use javascript instead in detecting the Flash player. You can have your index page contain the javascript Flash plug-in check then redirect your users to the flash page if they have the plug-in or to the download page when they don’t have the player.

The script is as follows:

```php

<SCRIPT LANGUAGE=JavaScript1.1>
<!--
var MM_contentVersion = 5;//this is the version of flash you want to detect
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("downloadflash.html");//this is the download page if the user does not have the plug-in
}
else{
	window.location.replace("flashcanplay.html");//this is the main page if the user has the plug-in
} 
//-->

</SCRIPT>

```

You have to place that script within the \<head\> tags of your index.html.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 19, 2003, 4:09pm UTC](https://forum.kirupa.com/t/flash-5-detection/28426/3 "2003-08-19T16:09:35Z")

</div>

Thanks comicGeek!
