Click to See Complete Forum and Search --> : Centering Flash Websites??


setmybabyfree
08-08-2006, 06:54 AM
Hi people,

I've designed a website in flash but I don't know how to center it horizontally as well as vertically. I know that if I ad a <center> tag, that centers it horizontally only. Does anyone know how to center it so that when you re-scale your browser, the website remains centered horizontally and vertically?

The code at the moment is this:

<title>main</title>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<center>
<object classid="clsid:d28cdb6e-ae6d-12cf-97b7-444772540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="910" height="500" id="main" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="main.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="main.swf" quality="high" bgcolor="#ffffff" width="910" height="500" name="main" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</center>
</body>
</html>


For an example to see what I mean look at http://www.louisvuitton.com

Your help would be greatly appreciated,
Thanks.

Natdrip
08-09-2006, 06:18 PM
:D use a table!

worthyashes
08-11-2006, 05:23 AM
Yep - table's quickest. It's a bit of a blag and SEO boys'll frown, but hey - it's flash, no search engine can read it anyway!

wh666-666
08-11-2006, 01:56 PM
Change your width and height to percentages (100% on both)

worthyashes
08-14-2006, 04:52 AM
Change your width and height to percentages (100% on both)

If you mean when you publish the movie out of Flash - don't. It blows all the fonts, pictures, everything and looks horrible.

If you want to hvae a liquid site in flash it is possible. You use the Stage object and more specfically the Stage.onResize() function. You are then in the business of dynamically attaching movieclips from the library.

There are some good tutoriasl out these, I can't remember the urls at the mo, but the help in Flash isn't too bad for the Stage object.

wh666-666
08-14-2006, 04:55 PM
I meant what i said, create the swf then alter the html to 100% width and height, it doesnt affect the formatting and looks exactly the same on all screens. I create flash website on a 17" and can view it in 14",15",17",19" etc. It doesnt matter at all what resolution/screen size you use

worthyashes
08-15-2006, 04:22 AM
I disagree - if you are setting the swf to 100% then it looks rubbish. If you are setting the table that holds it to 100% that's different.

Setting the swf to 100% DOES NOT WORK if you want to have a good looking site.

wh666-666
08-15-2006, 07:19 AM
We'll have to agree to disagree worthyashes as ive set the swf to 100% on alot of sites and never had a problem before but i was suggesting to alter the table (ie. html) to 100%. Ive done that before as well and works fine

Anyway looking at the site again through firefox 1.5 i dont have a problem with alignment at all, only with the height as i get a small scroll.

crazycoder
08-18-2006, 06:06 PM
don't use a table they slow down your browser! put it into this:

<div style="margin: 0 auto;">
//embed stuff
</div>