# Auto Resize Problem

**URL:** <https://forum.kirupa.com/t/auto-resize-problem/281180>\
**Category:** flash\
**Created:** [February 5, 2009, 8:17pm UTC](https://forum.kirupa.com/t/auto-resize-problem/281180 "2009-02-05T20:17:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmatzen](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@mmatzen](https://forum.kirupa.com/u/mmatzen)\
**Post date:** [February 5, 2009, 8:17pm UTC](https://forum.kirupa.com/t/auto-resize-problem/281180/1 "2009-02-05T20:17:06Z")

</div>

Hello Everyone I have hit a wall.

I have a re-size function on this website im working on for my BG to scale, my content to stay centered, and my nav bar to always stay top right. I need some sort of if statement saying if my navagation is 200px from the left it needs to stop moving. I hope that makes since.

Any help would be great. Thanks

Here is my AS

```auto
Stage.scaleMode = "noScale";
Stage.align = "TL";

function fillBG() {
    background_mc._width = Stage.width;
    background_mc._x = Stage.width/2;
}
function centercontent() {
    splash_mc._x = Stage.width/2;
}

function navAlign() {
    navagation_container_mc._x = Stage.width;
}
navAlign();
centercontent();
fillBG();

var stageL:Object = new Object();
stageL.onResize = function() {
    fillBG();
    centercontent();
    navAlign();
};
Stage.addListener(stageL);

```
