# AS 2 class problem with Stage.height

**URL:** <https://forum.kirupa.com/t/as-2-class-problem-with-stage-height/217866>\
**Category:** flash\
**Created:** [March 2, 2007, 3:51pm UTC](https://forum.kirupa.com/t/as-2-class-problem-with-stage-height/217866 "2007-03-02T15:51:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![liquidFusion](https://avatars.discourse-cdn.com/v4/letter/l/4bbf92/32.png) [@liquidFusion](https://forum.kirupa.com/u/liquidFusion)\
**Post date:** [March 2, 2007, 3:51pm UTC](https://forum.kirupa.com/t/as-2-class-problem-with-stage-height/217866/1 "2007-03-02T15:51:54Z")

</div>

Hi guys.

I’m writing a very simple AS2 class, that only should create an empty movieClip and fill the stage with a box drawn with the lineTo property. But for some reason, Stage.height always returns a number that is exactly 100px less than the actual stage height. Any ideas to why this happens?

See class code below for more information:

```auto

class centre {
	
	public function centre() {
		createBg();
		trace("width: " + Stage.width);
		trace("height: " + Stage.height);
	}
	
	private function createBg():Void {
		var depth:Number = 1;
		var colour_fill:String = "0x0000FF";
		var alpha_fill:Number = 30;
		var strokeThickness:Number = 5;
		var colour_stroke:String = "0xFF00FF";
		var alpha_stroke:Number = 100;
		
		_root.createEmptyMovieClip("bg_mc", depth);
		_root.bg_mc.beginFill(colour_fill, alpha_fill);
		_root.bg_mc.lineStyle(strokeThickness, colour_stroke, alpha_stroke);
		
		_root.bg_mc.moveTo(0, 0);
		_root.bg_mc.lineTo(0, Stage.height);
		_root.bg_mc.lineTo(Stage.width, Stage.height);
		_root.bg_mc.lineTo(Stage.width, 0);
		
		_root.bg_mc.endFill();
	}
}

```

Thanks for your time folks 🙂
