# Errors with stageWidth/stageHeight in package

**URL:** https://forum.kirupa.com/t/errors-with-stagewidth-stageheight-in-package/254905
**Category:** Uncategorized
**Created:** [March 17, 2008, 5:39am UTC](https://forum.kirupa.com/t/errors-with-stagewidth-stageheight-in-package/254905 "2008-03-17T05:39:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bmilesp](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@bmilesp](https://forum.kirupa.com/u/bmilesp)
#### Post date: [March 17, 2008, 5:39am UTC](https://forum.kirupa.com/t/errors-with-stagewidth-stageheight-in-package/254905/1 "2008-03-17T05:39:31Z")

</div>

hello everyone, I’m trying to make a class that will scale a clip when the stage resizes. I have the Stage resize set to NO\_SCALE so the majority of clips on the stage will not scale, however i want to make an exception. So i wrote the package below. However, when i try to run the movie, it throws this error:

1119: Access of possibly undefined property stageWidth through a reference with static type Class.

Obviously i’m missing something and need some help. Thanks in advance.

package bmilesp.display.LayoutTools {

```
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.display.MovieClip;

public class LayoutTools {
    
    private var _stageOriginalWidth:Number = Stage.stageWidth;
    private var _stageOriginalHeight:Number = Stage.stageHeight;

    public function scaleWithStage(my_clip:MovieClip):void{
        var scaleChangeWidth:Number = Stage.stageWidth/_stageOriginalWidth;
        var scaleChangeHeight:Number = Stage.stageHeight/_stageOriginalHeight;
        my_clip.width = my_clip.width * scaleChangeWidth;
        my_clip.height = my_clip.height * scaleChangeHeight;
    }
}

```

}
