2

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

基本上,我想从我的文档类中转到主时间轴上的 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.

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

4

1 回答 1

3
MovieClip(root).gotoAndStop(3);
于 2012-05-08T10:47:44.457 回答