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

Centralize page - ¿AS3 or HTML?

New Here ,
May 31, 2010 May 31, 2010

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

div align = "center"

text-align:center;

width:500px;

margin:auto;

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

TOPICS
ActionScript

Views

622

Translate

Translate

Report

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

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.

Votes

Translate

Translate

Report

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

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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