Simple rescale stage class needs helps


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

var stageTest:StageScale = new StageScale();

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