As3动态获取舞台大小

//txt为舞台上的文本,用来显示舞台宽高变化,No_SCALE模式下,resize事件才有用啦!
import flash.events.Event;
this.stage.scaleMode = StageScaleMode.NO_SCALE;
txt.text = “舞台宽:”+this.stage.stageWidth+”\n”+”舞台高:”+this.stage.stageHeight;
this.stage.addEventListener(Event.RESIZE,dor);
function dor(e:Event):void
{
txt.text = “舞台宽:”+this.stage.stageWidth+”\n”+”舞台高:”+this.stage.stageHeight;
}

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>