gpt4 book ai didi

actionscript-3 - AS3 : Call gotoAndStop() on MainTimeline, 来自文档类

转载 作者:行者123 更新时间:2023-12-04 05:47:28 24 4
gpt4 key购买 nike

我觉得自己不得不问这个问题,这是我项目的最后一部分,应该非常容易解决:/但是,在这里访问了许多类似的问题,我可以报告没有经过验证的答案解决了我的问题问题。

基本上,我想从我的文档类中的主时间轴上 gotoAndStop(3) 。但是,我似乎无法做到这一点..我已经尝试了以下两种方法,但都不起作用(都抛出了不同的错误)。

var stageRef:Stage;
stageRef = stage;
stageRef.gotoAndStop(3)

错误:
Line 148    1061: Call to a possibly undefined method gotoAndStop through a reference with static type flash.display:Stage.

第二种方法:
var MainTimeline:MovieClip = this.parent as MovieClip;
MainTimeline.gotoAndStop(3);

错误:
Line 148    1042: The this keyword can not be used in static methods. It can only be used in instance methods, function closures, and global code.

这两个解决方案都被其他用户标记为有效/正确,但我似乎无法让它们工作..我觉得很傻。任何帮助将不胜感激!干杯。

最佳答案

MovieClip(root).gotoAndStop(3);

关于actionscript-3 - AS3 : Call gotoAndStop() on MainTimeline, 来自文档类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10496929/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com