Access main stage properties within a class

Hello all,

Does anyone have solutions to accessing the main stage properties from within a class?

Currently I have a movieClip with something in there that is sized at 900 (width) x 500 (height) with a linkage name called myMC in my library.

So in my class, i have the following:


var testmc_mc:myMC = new myMC();
addChild(testmc_mc);
testmc_mc.addEventListener(Event.ADDED_TO_STAGE, dosomething);

here is the dosomething function:


private function dosomething(event:Event):void{
  stage.addEventListener(Event.RESIZE, resizestage);
}

and here is resize stage:


private function resizestage(event:Event):void{
  trace(stage.width);
}

Now the problem is this, when i resize the window to less than 900 px, it gives out a huge number, something in the vincinity of 1800. However, when the window is > 900 px ie 1200, the readout gives 1200.

Is there anyway to only get the stage parameters of the main stage?

Thanks :smiley: