all groups > macromedia flash sitedesign > october 2003 >
You're in the

macromedia flash sitedesign

group:

How do I center a .swf embedded in Html?


How do I center a .swf embedded in Html? Eiberg
10/20/2003 3:33:43 PM
macromedia flash sitedesign: HI
I need to center my flashmovie so it is in the middel of the html-page no matter the resolution?
It is made as a popup - but it doesnt have to be like that if that's a problem!
Help is very appriciated.

Thanx in advance.


Re:How do I center a .swf embedded in Html? emadsen
10/20/2003 5:34:34 PM
code your swf into a table or div that is aligned center horizontally and middle vertically.

Erik


Erik Madsen
Re:How do I center a .swf embedded in Html? Andy2112
10/20/2003 6:22:15 PM
Add the <center> tag before the <object> tag on the HTML page, then put the </center> after the </object> tag.


ACS
Re:How do I center a .swf embedded in Html? Eiberg
10/20/2003 8:52:11 PM
Thanx Andy2112

Now it's centered, but to the top - I would like it to be "smack" in the middel of the page.
Any surgestions?

Re:How do I center a .swf embedded in Html? emadsen
10/20/2003 9:28:14 PM
Andy's suggestion is incomplete and outdated. The center tag has been depreciated from the standard. Embed your swf into table that is 100% wide and 100% high. Set the td to align center and vertical middle.

<table width=100% height=100%>
<tr>
<td align="center" valign="middle">
<embed flash here>
</td>
</tr>
</table>

Erik Madsen
Re:How do I center a .swf embedded in Html? Eiberg
10/20/2003 10:10:06 PM
Hi Erik
I tried it - but I must have gotton something wrong because I can't get to work!
I'am new at this so I am sure it's my mistake.
Could you take a look?
www.storydwelling.dk/site.html

Another thing I would really like it if it could scale it self to Screen resolution - do you know how?

Re:How do I center a .swf embedded in Html? emadsen
10/20/2003 10:23:19 PM
Your movie is LARGE. You should consider designing at 800x600 (the common resolution denominator) and let your visitors determine the scale the movie is displayed at. This does introduce some challenges, but look at the source for this page...

http://taurus24.com/astroflash/

It's not a great example, since the orbits can take a long time to plot, but you will see that my movie works at any window size or resolution. There is also some actionscript in there that keeps the flash elements from scaling.

Stage.scaleMode = "noScale";
Stage.align = "tl";

Erik Madsen
AddThis Social Bookmark Button