# Need script to work regardless whether stage is resized

**URL:** <https://forum.kirupa.com/t/need-script-to-work-regardless-whether-stage-is-resized/250588>\
**Category:** Uncategorized\
**Created:** [January 30, 2008, 7:43pm UTC](https://forum.kirupa.com/t/need-script-to-work-regardless-whether-stage-is-resized/250588 "2008-01-30T19:43:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![p\_ziity](https://avatars.discourse-cdn.com/v4/letter/p/a9a28c/32.png) [@p\_ziity](https://forum.kirupa.com/u/p_ziity)\
**Post date:** [January 30, 2008, 7:43pm UTC](https://forum.kirupa.com/t/need-script-to-work-regardless-whether-stage-is-resized/250588/1 "2008-01-30T19:43:38Z")

</div>

So I made a listener that moves around MCs when the stage is resized and it works great. However the script doesn’t work until the stage is resized . Below is the script and I would really appreciate it if you could show me how to get the script to work regardless if the browser is resized.

var stageResizeListener:Object = new Object();  
stageResizeListener.onResize = function() {

```
back_mc._x = Stage.width-back_mc.width;
back_mc._y = (Stage.height+1)/2;
next_mc._x = Stage.width-next_mc._width;
next_mc._y = (Stage.height+1)/2;

```

};  
Stage.align = “TL”;  
Stage.scaleMode = “noScale”;  
Stage.addListener(stageResizeListener);  
Stage.addListener(sizeListener);
