PDA

View Full Version : something easy, surely



iheartyou
04-26-2007, 06:27 PM
hi everyone its probably really simple but im really rubbish using code im using dreamweaver and it never works how i want it to. basically i have my .swf file on a html black page and i want it centered in the middle of the broswer (complete centre) with a black background. and i also want it to stay centered no matter what screen rez or whether the window is resized.

valign=centre and align=centre

doesnt seem to work, any ideas?? thnx for any help - heres the full code of the page;


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Index</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style></head>
<body bgcolor="#000000">
<script language="JavaScript">
function Launch(page, width, height) {
OpenWin = this.open(page, "kirupa", "toolbar=no, menubar=no ,location=no, scrollbars=yes, resizable=yes, width=" + width + ", height=" + height + ", top=" + (screen.height/2 - height/2) + ", left=" + (screen.width/2 - width/2) + "\"");
}
</script>
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="132" height="122">&nbsp;</td>
<td width="78">&nbsp;</td>
<td width="772">&nbsp;</td>
<td width="141">&nbsp;</td>
</tr>
<tr>
<td height="515">&nbsp;</td>
<td colspan="2" align="center" valign="middle"><object classid="clsid:27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="850" height="515">
<param name="movie" value="1.swf">
<param name="quality" value="high">
<embed src="1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="850" height="515"></embed>
</object></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="73">&nbsp;</td>
<td valign="top"><embed src="music.mp3" width="0" height="0"></embed></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="57">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>

boogyman
04-26-2007, 06:32 PM
...
body {
background-color: #000000;
}
#_center_content_ {
margin: 0 auto;
text-align:center;
width: 100&#37;;
min-width: 800px;
}
...




...
<body>
<div id="_center_content_">
__VIDEO_FILE___
</div>
</body>
...

Twey
04-26-2007, 07:10 PM
Nope. Won't centre it vertically.

iheartyou, beware DreamWeaver: it produces very bad code (like this hideous thing). Try:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html/strict.dtd">
<html>
<head>
<title>Index</title>
<style type="text/css">
body {
background-color: black;
color: white;
}

.movie-container {
position: absolute;
top: 50&#37;;
left: 50%;
}

.movie {
width: 850px;
margin-left: -425px;
height: 515px;
margin-top: -257px;
}
</style>
</head>
<body>
<div class="movie-container">
<object
type="application/x-shockwave-flash"
data="c.swf?path=movie.swf"
width="850"
height="515"
>
<param name="movie" value="1.swf">
<param name="quality" value="high">
</object>
</div>
</body>
</html>A quick (but not completely exhaustive) check for the quality of code is to run it through the validator (http://validator.w3.org/). You should be using the HTML 4.01 Strict DOCTYPE.