Positiong 基于根阶段加载的对象,而不是从根加载的 MC

发布于 2024-08-26 01:11:44 字数 207 浏览 4 评论 0原文

我有一个根舞台和一个从根舞台调用的 MC。现在从该 MC,我将调用另一个 MC2,我想将 MC 放置在舞台中央。我无法在 MC 处使用正常的 ADDED_TO_STAGE 并定义中心的原因是因为 MC 没有放置在根阶段的确切位置(如 x,y=0)。因此,如果我将 MC2 定位在 MC 舞台中心,那么它就不是根舞台/屏幕的确切中心。

如何调用根舞台属性而不是将 MC2 添加到舞台中?

I have a root stage, and a MC that is called from the root stage.Now from that MC, i will called in another MC2, and I wanted to placed the MC in the center of the stage. The reason I could not use normal ADDED_TO_STAGE at MC and define the center is because MC is not place in the exact position of the root stage (as in x, y=0). So if I would target MC2 at MC stage center, it would not be the exact center of the root stage/screen.

How can I called the root stage properties rather than adding MC2 into the stage?

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

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

发布评论

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

评论(1

久隐师 2024-09-02 01:11:44

You should look into localToGlobal() method that will translate your nested coordinates into global position

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