var ratio:Number=designW/designH;
var sx:Number=stageWidth/designW;
var sy:Number=stageHeight/designH;
var scale:Number=Math.min(sx,sy);//取min所有内容一定显示在舞台内,取max就会拉伸超出
sprite.scaleX=scale;
sprite.scaleY=scale;
//sprite以左上角为注册点,坐标为(0,0)
//居中
sprite.x=(stageWidth-designW*scale)*0.5;
sprite.y=(stageHeight-designH*scale)*0.5;
如果designW=960,designH=640,那么sprite可显示的高最好也是960,sprite可显示的宽就视屏幕的宽而定