[SWFObject] Center flash movie in html?

Toby toby at creativefibre.co.uk
Mon Sep 25 17:09:26 PDT 2006


Hey, I am slightly tired and misreading things but I have just done
something slightly similar recently?

Its probably got holes all through it, but I always have to do things in a
rush, just put the flash movie's dimensions as width & height for
#flashcontent and its height under table#content (and width if you like too
I guess...)

Time for bed (in the uk)!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
	<title>Tit le</title>
	<meta name="description" content="Description" />
	<meta name="keywords" content="Keywords" />
	
<!--<script>self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHei
ght);</script>-->
	<script type="text/javascript" src="js/flashobject.js"></script>

	<script type="text/javascript" src="js/global.js"></script>
	<style type="text/css">
		/* hide from ie on mact \*/
		html {height: 100%;}
		#flashcontent {height: 700px; width: 800px;}
		/* end hide */
		*{padding: 0px; margin: 0px; border: 0px none #fff;}
		html, body {
			height: 			100%;
			background-color: 	#fff;
			color:				#000000;
			font-family:		Verdana, Arial, Helvetica,
sans-serif;
			font-size:			10px;
		}
		table#stage{
			width: 				100%;
			height: 			100%;
		}
		table#content{
			width: 				100%;
			height: 			674px;
		}
		div#altContent{
			width: 				600px;
			height: 			200px;
			display: 			block;
			text-align: 		left;
		}
		a, a:hover, a:visited{
			color: 				#000000;
			font-weight: 		bold;
			text-decoration:	none;
		}
	</style>
</head>
<body>
	<table id="stage">
	<tr>
	<td align="center">
		<table id="content">
		<tr>

		<td align="center" valign="middle">
			<div id="flashcontent">
				<div id="altContent">
					<p>
						You may not have the correct
Flash Player to view this site.<br />
						Please <a
href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=S
hockwaveFlash">click here</a> to download it for free. If you have just
installed the latest version  <a href="index.html?detectflash=false">click
here</a> to reload the page.<br />

						<br />
						<a href="email at email.com"
id="email">email at email.com</a>
					</p>
				</div>
			</div>
		</td>
		</tr>
		</table>

	</td>
	</tr>
	</table>
	<script type="text/javascript">
		// <![CDATA[

		var fo = new FlashObject("main.swf", "main", "100%", "100%",
"8", "#fff");
		fo.addParam("scale", "noscale");
		fo.write("flashcontent");

		// ]]>
	</script>
</body>
</html>





More information about the Swfobject mailing list