Hi people.
Hi. I have done the javascript /flash detection tutorial that displays an image if the user has no player. It works, except the image that displays appears at the top of the screen, and I need it to appear in the bottom right. Suspect its because the javascript is in a head tag. Any ideas?
I was told by someone I work with that that I have to “put it in a function and then call the function where I want the image to appear”. But I’m not sure on which line put the 'function { ’ or how to call it. and am too embarassed to ask.
Any help would be very much appreciated.
EDIT: This is the code Im using:
<SCRIPT LANGUAGE=JavaScript1.1>
<!–
function detect_flash {
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=“images/logos2.swf”> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> ‘);
document.write(’ <EMBED src=“images/logos2.swf” quality=high bgcolor=#FFFFFF ‘);
document.write(’ swLiveConnect=FALSE WIDTH=“463” HEIGHT=“146” 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=“images/noflash.gif” WIDTH=“463” HEIGHT=“146” usemap=”#script" BORDER=0>’);
}
//–>
</SCRIPT>
Thanks
Melissa