# Help! auto-resize. simple

**URL:** <https://forum.kirupa.com/t/help-auto-resize-simple/309775>\
**Category:** Uncategorized\
**Created:** [May 24, 2010, 6:29pm UTC](https://forum.kirupa.com/t/help-auto-resize-simple/309775 "2010-05-24T18:29:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jspark11](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@jspark11](https://forum.kirupa.com/u/jspark11)\
**Post date:** [May 24, 2010, 6:29pm UTC](https://forum.kirupa.com/t/help-auto-resize-simple/309775/1 "2010-05-24T18:29:03Z")

</div>

I want to do exactly this in AS2: (auto-resizing)

[http://www.kirupa.com/developer/as3/resizing\_centering\_as3.htm](http://www.kirupa.com/developer/as3/resizing_centering_as3.htm)

If you look at the source it`s very simple:

[INDENT][SIZE=1]function init()  
{  
stage.align=StageAlign.TOP\_LEFT;  
stage.scaleMode=StageScaleMode.NO\_SCALE;

```
stage.addEventListener(Event.RESIZE, updateSize);
stage.dispatchEvent(new Event(Event.RESIZE));

```

}  
init();

function updateSize(e:Event)  
{  
//Set background’s size  
backgroundMC.width = stage.stageWidth;  
backgroundMC.height = stage.stageHeight;

```
//center movie clip
contentMC.x = stage.stageWidth/2 - contentMC.width/2;
contentMC.y = stage.stageHeight/2 - contentMC.height/2;

//display the dimensions
contentMC.sizeText.text = stage.stageWidth + " by " + stage.stageHeight;

```

}[/SIZE]  
[/INDENT]How can I translate this into AS2???

[SIZE=2]Someone posted the same question here ([http://www.kirupa.com/forum/showthread.php?t=326805](http://www.kirupa.com/forum/showthread.php?t=326805)) but I really don`t understand the answer given.

a new answer would be much appreciated…Thanks in advance…  
[/SIZE]
