Flash MX detection - kirupa style

Hey all,

A question about the kirupa version of the flash Mx detection on this link

http://www.kirupa.com/developer/mx/detection.asp

I tried it but it doesn’t really work , does it ?

Because when i edit the place of the picture to another position, the flash should be swapped to the pictures position when flash is detected, right ??

Somehow the flash stays at the same position - top left…
No matter where i put the replacement image when flash is not detected.

Also… in Netscape i can see both (on a machine that has flash).
I see the image (somewhere on the page) and the flash is shown in the topleft.

Is this some scripting fault or am i just being crazy here :wink:

Could someone help me with this ??

surely some people must have had this before ??

big thanks !:hangover:

an example would be a great help…

Seeing as this is a javascript / html script, the issue will almost certainly be in your html formatting or adjustment of the javascript.

If you post the page and file (or a link to it), we should be able to help you. :bounce:

Sure…here’s the script…

i tried using this exact same code… nothing changed except for the filenames…

And what happened is the thing i described before

<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 ) {
		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="script" WIDTH="300" HEIGHT="200" ALIGN="">');
	document.write(' <PARAM NAME=movie VALUE="script.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
	document.write(' <EMBED src="script.swf" quality=high bgcolor=#FFFFFF  ');
	document.write(' swLiveConnect=FALSE WIDTH="300" HEIGHT="200" NAME="script" ALIGN=""');
	document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
	document.write(' </EMBED>');
	document.write(' </OBJECT>');
} else{
	document.write('<IMG SRC="script.gif" WIDTH="300" HEIGHT="200" usemap="#script" BORDER=0>');
}
//-->
</SCRIPT>

<IMG SRC="script.gif" WIDTH="300" HEIGHT="200" usemap="#script" BORDER=0>

Anyone with any thoughts about this one ??

Thanks in advance :bandit:

Anyone ??? PLEASE???

I have done the tutorial and it works fine. I don’t know where your problem lies…

And does it place the image in the place of the swf if there is no flash detected ??

because when i move the image to another location on the page… the swf just stays at the same position

maybe thats cos you have to move the swf to the same position you move the image to as well…?

Both the swf and image will have their own individual position settings in the code.