AS3 - 如何从 .as 文件中的类调用主时间线中的函数
我在主时间线定义了一些函数,我需要从类中调用它们,我该怎么做?
我已经尝试过
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(2)
您的班级是否尝试调用在该时间线内创建的主时间线上的函数?如果是这样,您可以存储时间线对象并调用它。舞台对象也可能有效。请提供更多详细信息。
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.
您在寻找
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 theDisplayList
for this to work.