Quick help: code edit

This code creates a two arbitrary sprites, box and circle, and puts them on the stage. The circle is the child of the box.

The purpose of the code is to enable the sprites to resize when the stage is resized. But the sprites only change size when the stage is smaller than their original size. When the stage is big enough, the sprites don’t get any bigger than their original size. Throughout, they maintain their proportions.

I’m interested in knowing if this code can be streamlined. Any inputs welcome.

// shrink sprite when stage is smaller than the sprite
// grow sprite when stage gets bigger, but only until it
//     reaches its original size
// maintain proportions

var boxW:Number = 200;
var boxH:Number = 150;
var box:Sprite = new Sprite();
box.graphics.beginFill(0x004488);
box.graphics.drawRect(-100, -75, boxW, boxH);
box.graphics.endFill();
addChild(box);

var circle:Sprite = new Sprite();
circle.graphics.beginFill(0xFF0000);
circle.graphics.drawCircle(0, 0, 50);
circle.graphics.endFill();
box.addChild(circle);

init();

function init():void {
	stage.align = StageAlign.TOP_LEFT;
	stage.scaleMode = StageScaleMode.NO_SCALE;
	stage.addEventListener(Event.RESIZE, updateSize);
	stage.dispatchEvent(new Event(Event.RESIZE));
}

function updateSize(e:Event):void {
	box.x = stage.stageWidth/2;
	box.y = stage.stageHeight/2;
	// if the stage is bigger than the box...
	if (stage.stageWidth > boxW && stage.stageHeight > boxH) {
		// ...the box is its original size.
		box.width = boxW;
		box.height = boxH;
	// but if the stage is smaller widthwise OR heightwise than the box:
	} else if (stage.stageWidth < boxW || stage.stageHeight < boxH) {
		// If the stage's w/h is smaller than the box's (taller)...
		if (stage.stageWidth/stage.stageHeight < boxW/boxH) {
			// ...reduce the box's width and scale height to width.
			box.width = stage.stageWidth;
			box.scaleY = box.scaleX;
		// But if the stage's w/h is larger than the box's (flatter)...
		} else {
			// ...reduce the box's height and scale width to height
			box.height = stage.stageHeight;
			box.scaleX = box.scaleY;
		}
	}
}