简体   繁体   English

Flash AS2 _root.gotoAndPlay()

[英]Flash AS2 _root.gotoAndPlay()

I have some problem with flash as2 coding. 我对flash as2编码有一些问题。 Problem is this: my built a flash app that has 3 frames in total. 问题是这样的:我构建了一个总共有3个帧的flash应用程序。 I wrote stop(); 我写了stop(); in second frame and root stopped on the second frame and movie clip in frame 2 starts to play. 在第二帧中,根停在第二帧上,第2帧中的影片剪辑开始播放。 I want to _root goto third frame when movie clip reachs the 30th frame. 当影片剪辑到达第30帧时,我想_root转到第三帧。

i use _root.gotoAndStop (3); 我使用_root.gotoAndStop (3); in movie clips 30th frame but that didn't work. 在电影剪辑第30帧但不起作用。

Please help me. 请帮我。

Ok, it's pretty simple, you are missing to point the right target, in your case, you are playing until 30th frame but inside a movie clip, and you want the action has impact in the _root wich means you need to point the root but... 好吧,它很简单,你缺少指向正确的目标,在你的情况下,你正在播放直到第30帧但在影片剪辑中,并且你希望该动作对_root有影响,这意味着你需要指向根但是...

But "_root" doesn't seems to work in your case, well... probably you have more than one scene, some times it mess a bit. 但是“_root”在你的情况下似乎不起作用,好吧......可能你有不止一个场景,有时它有点混乱。

use: 采用:

_parent.gotoAndStop(3);

instead of: 代替:

_root.gotoAndStop(3);

Make sure that you are writing this in the frame actions, some times I didn't pay atention and I wrote the code in the mc actions. 确保你在帧动作中写这个,有时我没有注意,我在mc动作中编写了代码。

Other thing, make sure you are working on AS2. 其他的,确保你正在使用AS2。

_root.gotoAndStop (3);
_root.gotoAndStop(3);

You put a space? 你放了一个空间?

Like mentioned above 如上所述

_parent.gotoAndStop(3);

Will also work.. 也会工作..

You can also do this in multiple nests, 你也可以在多个巢中做到这一点,

_parent.gotoAndStop(3);
_parent._parent.gotoAndStop(3);
_parent._parent._parent.gotoAndStop(3);

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

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