FORUMS: list search recent posts

keeping my website Centered!!

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Andrew Johnston
keeping my website Centered!!
on Aug 9, 2008 at 9:13:21 pm

Hello! I am currently making a website in flash and I am having a hard time figuring out how to keep the darn thing centered.

My website entirely made in flash, I want, when the viewer opens the site in a browser, that the document be centered in the browser and when the viewer resizes the window the site/document stays centered accordingly, it adjusts to fit the browser.

How do i do this? Remember I'm only using flash.

thanks a lot.

Return to posts index

Steve Duke
Re: keeping my website Centered!!
on Aug 11, 2008 at 9:58:12 pm


try using the
tags in your html, bracketing the code to launch your flash.


Return to posts index

Pieter Helsen
Re: keeping my website Centered!!
on Aug 11, 2008 at 11:20:38 pm

Go to File > Publish Settings... > HTML tab and select percent from the Dimensions droplist. Make sure it's set to 100%.

Press OK and create a layer beneath your actionscript layer. Name it Actions:Stage.

Insert this code on the first frame of the layer:
Stage.align = "TL";
Stage.scaleMode = "noScale";
Stage.showMenu = false;

this.onResize = function() {
// Here you use actionscript to position all the movieclip.
// Say you had a movieclip called my_mc that you want to put in the
// upper-right corner, this would be the code for it.
my_mc._x = Stage.width - my_mc._width;
my_mc._y = 0;

// Or you have a textfield called my_txt that you want centered.
my_txt._x = Stage.width/2;
my_txt._y = Stage.height/2;


Kind regards,

General notice: from now on, I would like to ask everyone to put [AS2] or [AS3] (corresponding to the version of actionscript you are using on your project) in front of their post titles when the question is actionscript related! Please help us help you faster. Thank you.

Return to posts index

Andrew Johnston
Re: keeping my website Centered!!
on Aug 13, 2008 at 5:07:17 pm

Thank you so much!!!!!

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved