AS3 - 如何从 .as 文件中的类调用主时间线中的函数

发布于 2025-01-06 04:21:16 字数 227 浏览 5 评论 0原文

我在主时间线定义了一些函数,我需要从类中调用它们,我该怎么做?

我已经尝试过

object(parent).function();

object(root).function();

但没有成功,

这些函数需要位于主时间轴上,因为它们删除了类的removeChild()

I have some functions defined at the main timeline, and I need to call them from a class, how can I do this?

I've tried

object(parent).function();

and

object(root).function();

but didn't worked

those functions need to be on the main timeline because they removeChild() of the class

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

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

发布评论

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

评论(2

寂寞清仓 2025-01-13 04:21:16

您的班级是否尝试调用在该时间线内创建的主时间线上的函数?如果是这样,您可以存储时间线对象并调用它。舞台对象也可能有效。请提供更多详细信息。

Is your class trying to call the function on the main timeline created inside that timeline ? If so you can store the timeline object and call it. Also stage object might work. Give more details please.

§普罗旺斯的薰衣草 2025-01-13 04:21:16

您在寻找 MovieClip(root).function() 吗?

请注意,您尝试访问 root 的对象必须位于 DisplayList 上才能正常工作。

Are you after MovieClip(root).function() ?

Note that the object you're trying to access root from needs to be on the DisplayList for this to work.

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