AS 2 class problem with Stage.height

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:


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 :slight_smile: