[SWFObject] Center flash movie in html?

Jud Holliday judh at ZAAZ.com
Mon Sep 25 15:31:56 PDT 2006


Here's an example which will center the content both horizontally and
vertically. You could probably strip out some of the table attributes
and use css for those too, but I just had this handy.

-Jud


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Title here</title>
	<script type="text/javascript" src="js/swfobject.js"></script>
	
<style type="text/css">

html { height: 100%; }
body { 
	height: 100%; 
	margin: 0;	
}

</style>
	
</head>
<body>

	<table cellpadding="0" cellspacing="0" border="0" height="100%"
width="100%">
	<tr>
		<td align="center">
			<div id="flashcontent">
				Alternate content here.
			</div>
			<script type="text/javascript">
				// <![CDATA[
				var so = new
SWFObject("yourfilename.swf", "main", "500", "400", "8", "#FFFFFF",
false); 
				so.write("flashcontent");
				// ]]>
			</script>
		</td>
	</tr>
	</table>

</body>
</html>

-----Original Message-----
From: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Mike Kaplan
Sent: Monday, September 25, 2006 2:23 PM
To: swfobject at lists.deconcept.com
Subject: [{SPAM?}] - [SWFObject] Center flash movie in html? - Sending
mail server found on relays.ordb.org

How do I go about centering my Flash movie in the html while using  
the SWFObject? I would like to contain it in a div tag if possible.
Thanks!
_______________________________________________
SWFObject mailing list
SWFObject at lists.deconcept.com
http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com



More information about the Swfobject mailing list