flash not rendering in Internet Explorer
Hi have the following flash object placed in HTML, flash seems to be rendering good in Firefox, Chrome, Safari but not in any version of IE!!!
Can someone please let me know whats wrong in this object, or what I miss specially for IE!!
Thanks in 开发者_开发百科advance, Tanmay
Use SWFObject for embedding Flash elements, it will solve all your cross-browser issues.
I believe you need the movie
param. This works for me:
<!doctype html>
<object data="http://jquery.thewikies.com/swfobject/fireworks.swf" width="440" height="550" name="demoLaunch" id="demoLaunch" type="application/x-shockwave-flash">
<param value="true" name="democonnect">
<param value="always" name="allowscriptaccess">
<param value="transparent" name="wmode">
<param value="demo1=1&demo2=3&demo3=12&demo4=19" name="flashvars">
<param name="movie" value="http://jquery.thewikies.com/swfobject/fireworks.swf">
</object>
It is better to rely on Javascript to control no flash fallbacks in addition to cross-browser JS for this purpose. I would recommend jquery swfobject.
Have you tried validating your HTML and CSS? You almost certainly have a coding error in there somewhere and that will help you find it. http://validator.w3.org/
Actually, the problem here is that you're using W3C valid HTML, which IE has a tendency not to get along with. To get IE to embed flash content you need to use embed, which does exactly the same thing as object but is not part of the W3C standard.
The syntax for the embed tag is as follows:
<embed src="somefilename.swf" width="550" height="400"></embed>
This is often just placed inside of the object tag, so that both options are on the page (don't worry, it won't be rendered twice in browsers that understand the object tag you already have).
A common way to get around using non-standard HTML is to do the embed with Javascript, which writes non-standard HTML code to the browser but not until after the page is rendered. This allows the page to pass the W3C HTML validator, and still work cross-platform. The best javascript library for doing this is generally SWFObject, which lets you just include the flash content once and will write html out for whatever browser the user is viewing your content in.
精彩评论