调用 stage.width 和 stage.stageWidth 的区别? [英] Difference between calling stage.width and stage.stageWidth?

查看:49
本文介绍了调用 stage.width 和 stage.stageWidth 的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在as3中调用stage.width和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.

推荐答案

根据 舞台类的 Adob​​e 参考:

  • 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.

这篇关于调用 stage.width 和 stage.stageWidth 的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆