# Simple rescale stage class needs helps

**URL:** https://forum.kirupa.com/t/simple-rescale-stage-class-needs-helps/232651
**Category:** Uncategorized
**Created:** [July 16, 2007, 6:23pm UTC](https://forum.kirupa.com/t/simple-rescale-stage-class-needs-helps/232651 "2007-07-16T18:23:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![joshchernoff](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshchernoff/32/1852_2.png) [@joshchernoff](https://forum.kirupa.com/u/joshchernoff)
#### Post date: [July 16, 2007, 6:23pm UTC](https://forum.kirupa.com/t/simple-rescale-stage-class-needs-helps/232651/1 "2007-07-16T18:23:40Z")

</div>

```php

package {
    public class StageScale {
        import flash.events.Event;
        function StageScale() {
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.addEventListener(Event.RESIZE, stageResized);
        }
        private function stageResized(event:Event):void {
            trace(stage.stageWidth, stage.stageHeight);
        }
    }
}

```

looks simple right? well it is. this class just displays the the scale of the stage upon resize but, I cant get this to work because I cant get the class to see the stage.

Errors;

> 1120: Access of undefined property stage.  
> stage.scaleMode = StageScaleMode.NO\_SCALE;

so what am I missing here?

in the fla I use

```php
var stageTest:StageScale = new StageScale();

```

I’m still really new to AS3 so go easy on me :trout:
