我有一个尺寸为:500x400 的影片剪辑。实例名称为:“main”。我有以下代码:
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener (Event.RESIZE, resizeHandler);
// initialize sizing
resizeHandler (null);
function resizeHandler (event:Event):void {
var sw:Number = stage.stageWidth;
var sh:Number = stage.stageHeight;
main.height = sh;
main.width = sw;
}
如何将 MovieClip 的大小调整比例和最大尺寸保持为 500x400?