动作脚本外部SWF填充屏幕

时间:2014-08-21 21:12:11

标签: android actionscript-3 air

我的AS3代码:

var ldr:Loader = new Loader();
ldr.load(new URLRequest("midos.swf"));
addChild(ldr);

但我的swf分辨率为720x460。

我的项目决议720x480。如何将我的swf全部填入项目屏幕?

1 个答案:

答案 0 :(得分:0)

//assuming that you want to scale it based on your stage. If not, just provide correct value
var targetHeight:Number = stage.stageHeight;    
var scale:Number = targetHeight / ldr.height;    
ldr.scaleY = scale;    
//if you want to scale proportionally    
ldr.scaleX = scale;