Movieclip.width 在宽度上返回比 Movieclip 阶段更高的值

发布于 2024-08-23 20:11:41 字数 250 浏览 7 评论 0原文

我在舞台上有一个影片剪辑,里面有嵌套的影片剪辑。全部引用于 0,0。所有子影片剪辑都不会加载任何动态内容、动画或具有遮罩层。它在子 MC 之一中确实有一个输入文本字段。父 MC 显示 280 px 宽度,而它返回 313 px 并带有 .width 迹线。没有代码可以在运行时更改父 MC 的 .width 值。舞台上的 ParentMC 未缩放(宽度/高度为 100%)。

有什么指示可以指出舞台上和运行时 .width 值差异的原因是什么吗?它破坏了后面的缩放代码。

I have a Movieclip on stage with nested movieclips inside. All referenced at 0,0. None of the child movieclips load any dynamic content, animate or have Masked Layers. It does have an input textfield in one of the child MCs. The parent MC shows 280 px width, while it returns 313 px with a .width trace. There is no code that alters the .width value of the parent MC at run-time. And the ParentMC on stage is not scaled (it is at 100% width/height).

Any pointers, to what could be the reasons for the discrepancy in .width values on stage and on run-time? Its breaking the scaling code that follows.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

汐鸠 2024-08-30 20:11:41

检查 TextFieldautoSize 属性。如果文本字段的大小autoSize 属性设置为默认 TextFieldAutoSize.NONE 以外的任何值。

另一种可能性是自定义绘图 - 您是否执行任何可能增加宽度的编程绘图?例如,如果您在尺寸最初设置为 50x50 的形状上绘制一个直径为 100px 的圆,则宽度和高度属性将显示为 100 而不是 50。

Check the autoSize property of the TextField. The size of a text field will vary according to the content if its autoSize property is set to anything other than the default TextFieldAutoSize.NONE.

Another possibility is custom drawing - are you performing any programmatic drawing that might increase the width? For instance, if you draw a circle of diameter 100px on shape whose size was initially set to 50x50, the width and height properties will read 100 and not 50.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文