Click to See Complete Forum and Search --> : swfobject multiple movies on page..


earth2mac
04-25-2009, 11:54 AM
Below is the code i generated. What if I have multiple flash movies on page? Do i use same script, and if so, do i need another id or need to make other modifications for other movies on page?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myFlashContent", "9.0.0");
</script>
</head>
<body>
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="myFlashContent">
<param name="movie" value="MainMovie.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="MainMovie.swf" width="800" height="600">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>

infinityspiral
04-27-2009, 11:11 AM
Yes you'd need a new id for each new swf on the page. You can use the same script. Usually with swf you'd create two divs with two different id's that the flash content would be dropped into not 2 objects. The whole idea being that if flash is detected each object would be inserted. This way if someone doesn't have flash they would get directions to install it. Otherwise they would simply receive the flash content.