窗口大小改变触发Event.RESIZE事件

//Event.RESIZE 窗口尺寸改变时 
stage.width,stage.height;//标识当前舞台上所有元素组合后的宽和高
stage.stageWidth,stage.stageHeight;//表示当前窗口的宽和高

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
mc.x = 0;
mc.y = 0;
stage.addEventListener(Event.RESIZE, resizeHandler);
function resizeHandler(evt:Event)
{
	mc.width = stage.stageWidth;
	mc.height = stage.stageHeight;
	trace(mc.width);
}
stage.dispatchEvent(new Event(Event.RESIZE));
原文地址:https://www.cnblogs.com/602147629/p/1918221.html