private function swfComHdl(_loader:Loader, _data:*= null){ frameLder = _loader; gameMC = frameLder.content as MovieClip; viewMc["container_mc"]["container_mc"].addChild(gameMC); //trace("src.view.LoadSwfShell类 ->swfComHdl() 加载swf成功 " + gameMC); //swf实际尺寸 var oldWidth:Number = frameLder.contentLoaderInfo.content.width; var oldHeight:Number = frameLder.contentLoaderInfo.content.height; //swf原舞台尺寸 var stageWidth:Number = frameLder.contentLoaderInfo.width; var stageHeight:Number = frameLder.contentLoaderInfo.height; var nowWidth:Number =viewMc["container_mc"]["mask_mc"].width; var nowHeight:Number =viewMc["container_mc"]["mask_mc"].height; trace("src.Main ->swfComHdl() frameLder ",Const.stageWidth , stageWidth , nowHeight / stageHeight);// //trace(frameLder.contentLoaderInfo.content.width,"被加载进来的宽度"); if (nowWidth / stageWidth > nowHeight / stageHeight){ trace(nowHeight / stageHeight, "大于比例"); gameMC.scaleX = gameMC.scaleY = nowHeight / stageHeight; gameMC.x = (nowWidth / stageWidth - nowHeight / stageHeight) * stageWidth / 2; }else if (nowWidth / stageWidth< nowHeight / stageHeight){ trace(nowWidth/stageWidth, "小于比例"); gameMC.scaleX = gameMC.scaleY = nowWidth / stageWidth; gameMC.y = (nowHeight / stageHeight - nowWidth / stageWidth) * stageHeight / 2; //gameMC.y = (nowHeight -gameMC.height) / 2; }else{ trace("相同",nowHeight/stageHeight) gameMC.scaleX=gameMC.scaleY= nowHeight/stageHeight; } Const.root_mc["isShowMLoading"](false); //getAllBtn(); //viewMc.addChild(gameMC); //gameMC.addEventListener(Event.ENTER_FRAME, gameEFHdl); //MyEventDispatcher.getInstance().dispatchEvent(new MyEvent(MyEvent.DTDISPATHCDATA,"SystemIdleMode_KeepAwake")); }