Reputation: 27038
i have a piece of flash that doesn't want to play in internet explorer:
<div class="flash_slider">
<object style="visibility: visible;" id="flashcontent" data="/files/theme/piecemakerNoShadow.swf" type="application/x-shockwave-flash" height="460" width="980">
<param value="transparent" name="wmode">
<param value="xmlSource=/files/theme/piecemakerXML.xml&cssSource=/files/theme/piecemakerXML.css&imageSource=/files/theme/" name="flashvars">
</object>
<script type="text/javascript">
var flashvars = {};
flashvars.xmlSource = "/files/theme/piecemakerXML.xml";
flashvars.cssSource = "/files/theme/piecemakerXML.css";
flashvars.imageSource = "/files/theme/";
var attributes = {};
attributes.wmode = "transparent";
swfobject.embedSWF("/files/theme/piecemakerNoShadow.swf", "flashcontent", "980", "460", "10", "/files/theme/expressInstall.swf", flashvars, attributes);
</script>
</div>
any ideas? thanks
Upvotes: 0
Views: 576
Reputation: 55200
Target IE using conditional comments.
<!--[if !IE] >
<script type = "text/javascript" >
var flashvars = {};
flashvars.xmlSource = "/files/theme/piecemakerXML.xml";
flashvars.cssSource = "/files/theme/piecemakerXML.css";
flashvars.imageSource = "/files/theme/";
var attributes = {};
attributes.wmode = "transparent";
swfobject.embedSWF("/files/theme/piecemakerNoShadow.swf", "flashcontent", "980", "460", "10", "/files/theme/expressInstall.swf", flashvars, attributes);
</script>
<![endif]-->
As you are loading flash through SWFObject, it will ensure that your script won't run in IE.
Also try browser sniffing. ( Not recommended, but I dont see any other way here )
var isMSIE = /*@cc_on!@*/false;
if(!isMSIE){
var flashvars = {};
flashvars.xmlSource = "/files/theme/piecemakerXML.xml";
flashvars.cssSource = "/files/theme/piecemakerXML.css";
flashvars.imageSource = "/files/theme/";
var attributes = {};
attributes.wmode = "transparent";
swfobject.embedSWF("/files/theme/piecemakerNoShadow.swf", "flashcontent", "980", "460", "10", "/files/theme/expressInstall.swf", flashvars, attributes);
}
If that does not work, try
var isMSIE = navigator.appName === 'Microsoft Internet Explorer';
This might help you: http://pipwerks.com/2011/05/18/sniffing-internet-explorer-via-javascript/
Upvotes: 1