private function onResizeHandler(){ var diffWidth:Number = Stage.width - this._width; var diffHeight:Number = Stage.height - this._height; var aRatio:Number = this._width / this._height; if(diffWidth >= diffHeight){ this._width = Stage.width; this._height = Stage.width / aRatio; } else { this._height = Stage.height; this._width = Stage.height * aRatio; } }