views:

39

answers:

4

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

A: 

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/

Bubby4j
+1  A: 

Use SWFObject for embedding Flash elements, it will solve all your cross-browser issues.

TandemAdam
A: 

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&amp;demo2=3&amp;demo3=12&amp;demo4=19" name="flashvars"> 
    <param name="movie" value="http://jquery.thewikies.com/swfobject/fireworks.swf"&gt; 
</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.

meder
@meder: That really worked for me. Thanks a lot.
jtanmay
@meder: Also thanks for mentioning the jquery swfobject, that really looks good and will try to implement it. Thanks
jtanmay
A: 

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.

SteveH
You don't need to use the `embed` element. See my answer.
meder
Thanks everyone for your suggestions and ways to implement. This will help me to improve my knowledge more for Flash ( as I am very noob on flash part).Meder's suggestion helped out on this part. Thanks
jtanmay