Copy link to clipboard
Copied
Hi. I need to centralize my page and I can't do it with AS3. My whole page is made by Flash but I've reed that is nessesery do it with HTML in idex file. I've seen in a manual this 2 types of code (in body):
1º
div align = "center"
2º
text-align:center;
width:500px;
margin:auto;
I've tryed bouth of them and it dosen't work.
Copy link to clipboard
Copied
Do you know a little bit of CSS?
If you do so, you could try something like:
#flash_content {
width: 750px;
height: 450px;
position: absolute;
top: 50%;
left: 50%;
margin-left: -375px;
margin-top: -225px; }
You set the exact width and height of your flash content, set position to absolute, move the content 50% from top and left and "discount" half of the size of your content to left and top.
Copy link to clipboard
Copied
Actually this css method will center the swf for only one particular browser window's dimension.
Try swfObject to embed in HTML your swf:
http://code.google.com/p/swfobject/
and here, in point 10., it is explained how to center the swf:
http://code.google.com/p/swfobject/wiki/faq
Copy link to clipboard
Copied
This css is for a div where he should put his swf file using something like swfobject (which I think he's already using).
If he uses this css, when he resizes the page, the swf will automaticaly be "recentered" according to the size of the page.
At least it's working with my website. =/