Html alignment

hi everybody!

i’m trying to center my flash movie vertically and horizontally on any screen. since i’m not very familiar with html, i’m kinda struggling… what code do i need to put in my html page?

thanks for any help!

martin

There are various ways to get your swf centered. This is what I normally do:
One file (index.htm) contains 3 frames (horizontal ones).

code for index.htm would look like this: (between <html></html> tags)

<frameset rows=",555," frameborder=“NO” border=“0” framespacing=“0”>
<frame src=“maintop.htm” name=“topFrame” scrolling=“NO” noresize >
<frame src=“mainmiddle.htm” name=“mainFrame” scrolling=“no” noresize>
<frame src=“mainbottom.htm” name=“bottomFrame” scrolling=“NO” noresize>
</frameset>
<noframes><body>
</body></noframes>

where:

  • = current resolution - 555 / number of * (in this case 2)
    555 = height of your swf file

Remember: your maintop, mainmiddle and mainbottom shouldn’t have any margins if you do use margins then the “555” should be “height of your swf + 2xmargin”

Put your swf in mainmiddle and code it like this: (between <html></html> tags)

<body topmargin=“0” bottommargin=“0”>
<table width=“100%” border=“0” cellpadding=“0” cellspacing=“0”>
<!–DWLayoutTable–>
<tr>
<td width=“100%” height=“100%” align=“center” valign="middle>
HERE YOUR SWF
</td>
</tr>
</table>
</body>

That should do the trick…

that’s a bloody difficult way of doing it!!


<table height=100% width=100%>
<tr><td valign="middle">
  <center>
    code for your swf
  </center>
</td></tr>
</table>

that ought to save you a few kb’s of webspace compared to another certain method :wink:

wait a second! it’s the same code. how come you made it so long-winded!!! i’m so confused… sorry.

[edit] Oh, I see. all of that stuff you’ve got about puting in all that nonsense with the height of the flash movie and the resoluction is NOT required.[/edit]

thanks boys! :thumb: