调用stage.width和stage.stageWidth之间的区别?区别、stage、width、stageWidth

2023-09-08 13:48:48 作者:凉陌如花

在AS3是什么叫stage.width和stage.stageWidth

In as3 What is the difference between calling stage.width and stage.stageWidth

我读的地方,如果我们什么都没有在舞台上那么 stage.width值为0 但是当我什么都没有的阶段,但会发生什么动态加载在舞台上的内容?

I read somewhere that if we have nothing on stage then the value of stage.width is 0, but what happen when I have nothing on stage but loading contents dynamically on stage?

我已经试过这一点,当我已经加载的内容动态地在舞台上,然后我有

I have tried this and when i have loaded content dynamically on stage then i have got

  stage.width=value;  // where value is dynamic number

谁能解释这?? 谢谢。

Can anyone explain this?? thanks.

推荐答案

按照的Adobe参考Stage类:

stage.width

指示显示对象的宽度,以像素为单位。的宽度是 基础计算的所述显示对象的内容的范围。

Indicates the width of the display object, in pixels. The width is calculated based on the bounds of the content of the display object.

所以这个属性为你添加/删除从舞台元素的不同而不同。

So this property varies as you add/remove elements from the stage.

stage.stageWidth

指定舞台的当前宽度,以像素为单位。

Specifies the current width, in pixels, of the Stage.

为您调整Flash Player窗口此属性各不相同。

This property varies as you resize the Flash Player window.