# \[Ac2\] Help needed!center full screen problem

**URL:** https://forum.kirupa.com/t/ac2-help-needed-center-full-screen-problem/289993
**Category:** Uncategorized
**Created:** [June 8, 2009, 12:32pm UTC](https://forum.kirupa.com/t/ac2-help-needed-center-full-screen-problem/289993 "2009-06-08T12:32:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bealox](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@bealox](https://forum.kirupa.com/u/bealox)
#### Post date: [June 8, 2009, 12:32pm UTC](https://forum.kirupa.com/t/ac2-help-needed-center-full-screen-problem/289993/1 "2009-06-08T12:32:37Z")

</div>

Hi guys

I have a problem with the following actionsctipt. what this actionscript does is to position the “mc\_content” in the middle of page all the time, even the user trying to resize the window. but my problem is when you open the window “mc\_content” is not align in the middle, but after you resize the browser it will adjust in the middle of the page.

stop ();  
Stage.align = “TL”;  
Stage.scaleMode = “noScale”;

mc\_content.\_x = Math.floor((Stage.width - mc\_content.\_width) / 2);  
mc\_content.\_y = Math.floor((Stage.height - mc\_content.\_height) / 2);

sizeListener = new Object();  
sizeListener.onResize = function() {

mc\_content.\_x = Math.floor((Stage.width - mc\_content.\_width) / 2);  
mc\_content.\_y = Math.floor((Stage.height - mc\_content.\_height) / 2);

};  
Stage.addListener(sizeListener);
