user1272372
user1272372

Reputation: 90

Emedding flash in HTML for IE 8

this is the code I've used to embed my flash file:

<object id="flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="950" height="360" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" align="centre">
<param name="movie" value="/media/flash_final.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" /> <embed type="application/x-shockwave-flash" width="950" height="360" src="../media/flash_final.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" name=" Web" bgcolor="#ffffff" quality="high"></embed>
</object>

It does display on IE 8 however it does not maintain the width and height dimensions I have set. I have also made sure that my flash is 960 x 360. How can I get it to show my desired size in a way which will still be compatible with other browsers? Thanks :)

Upvotes: 0

Views: 10792

Answers (2)

user1272372
user1272372

Reputation: 90

I got it to work by adding css style width and height. Manish suggested it in another thread. Here's the code that worked for me:

<p> </p>
<p>
<object id="flash" style="width: 950px; height: 350px;" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="950" height="360" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" align="centre">
<param name="movie" value="/media/flash_final.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" /> <embed type="application/x-shockwave-flash" width="950" height="360" src="../media/flash_final.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" name="Web" bgcolor="#ffffff" quality="high"></embed>
</object>
<!--[if !IE]>-->                  
<object id="flash" style="width: 950px; height: 350px;" width="950" height="360" name="Web" data="media/flash_final.swf" type="application/x-shockwave-flash">
<param name="movie" value="media/flash_final.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#FFFFFF" />
<param name="allowScriptAccess" value="always" /> <!--<![endif]--> <a href="http://www.adobe.com/go/getflash"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" border="0" alt="Get Adobe Flash player" /> </a> <!--[if !IE]>-->
</object>
<!--<![endif]--></p>
<p> </p>

Thanks again guys. God bless!

Upvotes: 1

danii
danii

Reputation: 5693

Use SWFObject, it simplifies a lot the job of embedding the flash movie in HTML, it works cross browser like a charm and it allows you to set up an alternative content and target an specific version of the Flash Player really easily.

For example (I am posting only the relevant parts of the HTML):

<script type="text/javascript">
        swfobject.embedSWF("media/flash_final.swf", "flashmovie", "960", "360", "10.0.0", "media/expressInstall.swf");
        </script>

<!-- And in you body: -->  
<div id="flashmovie">
    Alternative content!    
</div>

Upvotes: 1

Related Questions