Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Centralize page - ¿AS3 or HTML?

Guest
May 31, 2010 May 31, 2010

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):

div align = "center"

text-align:center;

width:500px;

margin:auto;

I've tryed bouth of them and it dosen't work.

TOPICS
ActionScript
703
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 31, 2010 May 31, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 01, 2010 Jun 01, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 01, 2010 Jun 01, 2010
LATEST

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. =/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines