# What is the code equalant for AS2?

**URL:** <https://forum.kirupa.com/t/what-is-the-code-equalant-for-as2/323947>\
**Category:** flash\
**Created:** [July 25, 2011, 4:30pm UTC](https://forum.kirupa.com/t/what-is-the-code-equalant-for-as2/323947 "2011-07-25T16:30:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![learner\_7n](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@learner\_7n](https://forum.kirupa.com/u/learner_7n)\
**Post date:** [July 25, 2011, 4:30pm UTC](https://forum.kirupa.com/t/what-is-the-code-equalant-for-as2/323947/1 "2011-07-25T16:30:54Z")

</div>

Hi,

I got AS3 code for resizing/scaling the movie\_clip. I would like use it in my existing project which is in AS2 code. How to modify it for working with AS2? Please help.

**Code in AS3:**

```auto
 
// NO SCALE
stage.scaleMode=StageScaleMode.NO_SCALE;
 
// ALIGN TO TOP LEFT
stage.align=StageAlign.TOP_LEFT;
 
import flash.display.StageDisplayState;
stage.addEventListener(Event.RESIZE, onStageResize);
addEventListener(Event.ENTER_FRAME, onFrame);
 
// TILE BG //
var tile:Tile = new Tile;
var tileBG:TileBG = new TileBG(tile, this.stage,"normal");
 
// FULL SCREEN BUTTON ACTION //
BtnFullScreen_mc.addEventListener(MouseEvent.CLICK, onFullScreenClick);
BtnFullScreen_mc.buttonMode = true;
 
function onFullScreenClick(evt:MouseEvent):void {
stage.displayState = StageDisplayState.FULL_SCREEN;
}
 
// RESIZE STAGE FUNCTION //
function onStageResize(evt:Event):void {
 
// SCALE //
GalleryMovie_mc.scaleY=stage.stageHeight/800;
GalleryMovie_mc.scaleX=stage.stageWidth/1000;
 
GalleryMovie_mc.MainHeader_mc.scaleX=stage.stageWidth/1000;
}
 
// ON FRAME FUNCTION //
function onFrame(evt:Event):void {
  
BtnFullScreen_mc.x = 100;
BtnFullScreen_mc.y=stage.stageHeight-75;
 
// SCALE //
GalleryMovie_mc.scaleY=stage.stageHeight/800;
GalleryMovie_mc.scaleX=stage.stageWidth/1000;
 
GalleryMovie_mc.MainHeader_mc.scaleX=stage.stageWidth/1000;
}

```

Thanks in advance for any help.
