# \[Flash Pro CS5\] Help to convert AS3 Resizing code to AS2

**URL:** <https://forum.kirupa.com/t/flash-pro-cs5-help-to-convert-as3-resizing-code-to-as2/319123>\
**Category:** flash\
**Created:** [February 9, 2011, 1:19pm UTC](https://forum.kirupa.com/t/flash-pro-cs5-help-to-convert-as3-resizing-code-to-as2/319123 "2011-02-09T13:19:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cliffinator](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@Cliffinator](https://forum.kirupa.com/u/Cliffinator)\
**Post date:** [February 9, 2011, 1:19pm UTC](https://forum.kirupa.com/t/flash-pro-cs5-help-to-convert-as3-resizing-code-to-as2/319123/1 "2011-02-09T13:19:04Z")

</div>

Can anyone PLEASE Convert this to ActionScript 2.

I want to use this code in a flash project(it comes from a kirupa tutorial), but I also want to import as2 swf into the same project! So I need this code in AS2.

Thanks so much! =)

**Actionscript 3 to be converted:**

function init()  
{  
stage.align=StageAlign.TOP\_LEFT;  
stage.scaleMode=StageScaleMode.NO\_SCALE;

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

background_mc.x = 0;
background_mc.y = 0;

```

}  
init();

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

```
//center content
main_mc.x = stage.stageWidth/2 - main_mc.width/2;
main_mc.y = stage.stageHeight/2 - main_mc.height/2;

```

}
