# Access main stage properties within a class

**URL:** https://forum.kirupa.com/t/access-main-stage-properties-within-a-class/246440
**Category:** flash
**Created:** [December 11, 2007, 6:49am UTC](https://forum.kirupa.com/t/access-main-stage-properties-within-a-class/246440 "2007-12-11T06:49:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![anon4341189](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@anon4341189](https://forum.kirupa.com/u/anon4341189)
#### Post date: [December 11, 2007, 6:49am UTC](https://forum.kirupa.com/t/access-main-stage-properties-within-a-class/246440/1 "2007-12-11T06:49:44Z")

</div>

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:

```auto

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

```

here is the dosomething function:

```auto

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

```

and here is resize stage:

```auto

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 😃
