Design + Coding > Help with Flash banner not showing up in IE

Hi,

I'm trying to build a site at http://milagro.squarespace.com. I'm trying to use a flash banner with some code that displays an image if Flash is not present. It works fine in every browser I've tried but IE. I've tested in IE 6,7, and 8. All I see in place of the banner is a big white space. What am I doing wrong? Is there anything I can do to fix this? Below is the code I use.

<script language="javascript1.2">

<!--
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[i])))
continue;
var MM_PluginVersion = words[i];
}
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\> \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');
}
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="800" HEIGHT="300" ALIGN="">');
document.write(' <PARAM NAME=movie VALUE="script.swf"> <PARAM NAME=quality VALUE=high> <param name="loop" value="false" /> <PARAM NAME=bgcolor VALUE=#FFFFFF> ');
document.write(' <EMBED src="http://milagro.squarespace.com/storage/milagroflashbanner2bgrey.swf" quality=high ');
document.write(' swLiveConnect=FALSE WIDTH="800" HEIGHT="300" 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="http://milagro.squarespace.com/storage/milagro-banner-statice.jpg" WIDTH="800" HEIGHT="300" usemap="#script" BORDER=0>');
}
//-->
</SCRIPT>

Thanks for your help!

07.25.2009 | Registered CommenterWill Boyd

Ok, so now the same thing's happening in Firefox. But it looks great in Safari. I don't know what I've done wrong.

07.25.2009 | Registered CommenterWill Boyd

I think, at this point, I would be thrilled if someone could tell me how to change the if statement to exlude IE. Is that possible?

07.25.2009 | Registered CommenterWill Boyd

w00t! I have yet to figure out why my flash banner wasn't showing up in IE, but I was able to single out IE to display a .jpg image instead. Here's what I did.

<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[i])))
continue;
var MM_PluginVersion = words[i];
}
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\> \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');
}
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="800" HEIGHT="300" ALIGN="">');
document.write(' <PARAM NAME=movie VALUE="script.swf"> <PARAM NAME=quality VALUE=high> <param name="loop" value="false" /> <PARAM NAME=bgcolor VALUE=#FFFFFF> ');
document.write(' <EMBED src="http://milagro.squarespace.com/storage/milagroflashbanner2bgreynew.swf" quality=high ');
document.write(' swLiveConnect=false WIDTH="800" HEIGHT="300" NAME="script" ALIGN=""');
document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write(' </EMBED>');
document.write(' </OBJECT>');
} else if (navigator.appName=='Microsoft Internet Explorer') {
document.write('<IMG SRC="http://milagro.squarespace.com/storage/milagro-banner-statice.jpg" WIDTH="800" HEIGHT="300" usemap="#script" BORDER=0>');
}

else{
document.write('<IMG SRC="http://milagro.squarespace.com/storage/milagro-banner-statice.jpg" WIDTH="800" HEIGHT="300" usemap="#script" BORDER=0>');
}
//-->
</SCRIPT>

07.25.2009 | Registered CommenterWill Boyd

Sweet! i thoiught i was the only one haviong issues with IE not showing my flash.

thanks for posting your script. it will be loved.

11.6.2009 | Unregistered Commenterjeff