简体   繁体   English

TypeError:尝试从影片剪辑内部访问主时间轴时,Flash AS3中出现错误#1006

[英]TypeError: Error #1006 in flash AS3 while trying to access main timeline from inside movie clip

I have placed a movie clip on the main timeline, with instance name sq_mc . 我在主时间轴上放置了一个影片剪辑,实例名称为sq_mc Inside of it, there is sq_motion_tween_mc . 在里面,有sq_motion_tween_mc sq_motion_tween_mc is empty, and I have converted it to movie clip, because it was required to apply motion tweening. sq_motion_tween_mc为空,我已将其转换为影片剪辑,因为需要应用补间动画。

[1]------------------|[2]----------|
sq_mc                | ...
   |                 |
 sq_motion_tween_mc  |

There is a stop(); 有一个stop(); action on both the 1st and 2nd keyframe of the main timeline. 在主时间轴的第一个和第二个关键帧上执行操作。

I want to jump to the 2nd frame on the main timeline after playing last frame of sq_mc . 在播放sq_mc最后一帧后,我想跳至主时间轴上的第二帧。 Here's the code I have on the last frame of sq_mc : 这是我在sq_mc的最后一帧中得到的sq_mc

sq_motion_tween_mc.sq_mc(parent).gotoAndPlay(2);

And I get this error message: 我收到此错误消息:

TypeError: Error #1006: sq_mc is not a function. TypeError:错误#1006:sq_mc不是函数。 at Untitled_fla::square_1/frame24() 在Untitled_fla :: square_1 / frame24()

Note: Square is the name of the movie clip symbol for sq_mc . 注意: Squaresq_mc的影片剪辑符号的sq_mc

The motion tween has no relevance whatsoever to what you are trying to do. 补间动画与您要执行的操作没有任何关系。 Also, if it's empty, I'm not sure what you are tweening... 另外,如果它是空的,我不确定你正在补间什么...

Anyway, on the last frame of your Square MovieClip, do 无论如何,在Square MovieClip的最后一帧上

MovieClip(parent).gotoAndStop(2);

That's it. 而已。

If I understand what you are trying to accomplish, you either do: 如果我了解您要完成的工作,那么您可以:

sq_mc.sq_motion_tween_mc.gotoAndPlay(2); // sq_motion_tween_mc's timeline.

or 要么

sq_mc.gotoAndPlay(2); //sq_mc's timeline

or even 甚至

gotoAndPlay(2); //Main timeline

calling sq_mc(parent) is not legal if sq_mc is a MovieClip. 如果sq_mc是MovieClip,则调用sq_mc(parent)不合法。 The only function I see here is gotoAndPlay(). 我在这里看到的唯一函数是gotoAndPlay()。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM