Page 1 of 1

detect flash

Posted: Mon Sep 20, 2004 4:56 pm
by romeo
anyone know of a good script (javascript) that detect if the user does not have flash or a good version of flash and displays an image in place of yoru flash if they dont?

Posted: Mon Sep 20, 2004 5:05 pm
by feyd
there are detectors that come with flash's output.. you can probably find it on Macromedia's site.

when you export flash

Posted: Mon Sep 20, 2004 9:24 pm
by neophyte
When you export the movie you can set flash to publish a detection script but it's always the same script with a few variables changed out. The things that should be changed have {b] [/b] tags.

Code: Select all

<script LANGUAGE=JavaScript1.1>
<!--
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes&#1111;"application/x-shockwave-flash"]) ? navigator.mimeTypes&#1111;"application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) &#123;
		var words = navigator.plugins&#1111;"Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    &#123;
		if (isNaN(parseInt(words&#1111;i])))
		continue;
		var MM_PluginVersion = words&#1111;i]; 
	    &#125;
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
&#125;
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) &#123;
	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.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
&#125;
if ( MM_FlashCanPlay ) &#123;
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
	document.write(' ID="&#1111;b]name of file&#1111;/b]" WIDTH="207" HEIGHT="70" ALIGN="left">');
	document.write(' <PARAM NAME=movie VALUE="&#1111;b]FULL/PATH/TO/MOVIE&#1111;/b]"> <PARAM NAME=quality VALUE=high> <PARAM NAME=salign VALUE=L> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
	document.write(' <EMBED src="&#1111;b]FULL/PATH/TO/MOVIE&#1111;/b]" quality=high salign=L bgcolor=#FFFFFF  ');
	document.write(' swLiveConnect=FALSE WIDTH="&#1111;b]widthofmovie&#1111;/b]" HEIGHT="&#1111;b]heigthofmovie&#1111;/b]" NAME="&#1111;b]name of file&#1111;/b]" ALIGN="left"');
	document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
	document.write(' </EMBED>');
	document.write(' </OBJECT>');
&#125; else&#123;
	document.write('<IMG SRC="&#1111;b]Path to replacement image&#1111;/b]" WIDTH="207" HEIGHT="70"  BORDER=0>');
&#125;
//-->
</SCRIPT>

I forgot about that post.. here is what i used

Posted: Thu Oct 07, 2004 11:09 pm
by romeo
i actually found that script, thanks a bunch!