public class Main extends Sprite { public function Main() { this.graphics.beginFill(0xff0000, 1); this.graphics.drawRect(0, 0, stage.stageWidth/2, stage.stageHeight/2); this.graphics.endFill(); //set what part of the browser the stage will set itself in this.stage.align = StageAlign.TOP_LEFT; //set how the stage scales itself this.stage.scaleMode = StageScaleMode.NO_SCALE; //add an event listener for the stages resized event stage.addEventListener(Event.RESIZE, stageResized);
}
private function stageResized(event:Event):void { trace(stage.stageHeight+" "+stage.stageWidth);