Flash and the Object Tag

There are several ways of embedding flash in your web page using only the object tag. One method known as flash satay requires a modification to the flash file itself so as to allow it to work correctly both with IE6 and modern browsers. An alternative if you need to support older versions of Flash in IE6 is to use the nested object tag approach in order to supply one object tag that IE6 can understand and a second that more modern browsers can understand.

The following code assumes that you have a 300 x 200 flash movie called flash.swf. Simply substitute your correct values for the two occurrences of each of those values to get the code to work with your own flash.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/
continued from previous lineshockwave/cabs/flash/swflash.cab#version=6,0,40,0"
width="300" height="200">
<param name="movie" value="flash.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF">
<param name="wmode" value="transparent">
<!--[if gte IE 7]><!-->
<object data="flash.swf"
width="300" height="200" type="application/x-shockwave-flash">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF">
<param name="wmode" value="transparent">
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">
content for browsers that don't support flash go here
</object>
<!--><![endif]-->
</object>

If your movie requires a more recent version of Flash then you can simplify your code down to a single object tag since the special IE6 version is only required to support older versions of Flash. The actual swf file needs to be referenced twice since IE still looks for it in a different place to other browsers.

<object data="flash.swf"
width="300" height="200" type="application/x-shockwave-flash">
<param name="src" value="flash.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF">
<param name="wmode" value="transparent">
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">
content for browsers that don't support flash go here
</object>

Note that wmode needs to be set to transparent or opaque in order for other elements on the page to be able to move in front of your flash. This particular param is specific to flash.

go to top

FaceBook Follow
Twitter Follow
Donate