窗口大小改变触发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));
posted on
2010-12-27 18:36 
602147629 
阅读(4440
评论(0
编辑 
收藏 
举报

版权声明:本文为602147629原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/602147629/articles/1918221.html