Flash CS3 - 如何停止帧
我在第一帧菜单上创建的。 第二帧是我所有的游戏。我使用按钮更改框架:
button1.addEventListener(MouseEvent.MOUSE_DOWN, startGame1);
function startGame1(e:MouseEvent)
{
howManyPlayers = 1;
gotoAndStop(2);
}
但是框架 1 仍在工作,我可以看到它。 是否有可能:
- 关闭/停止帧 1
- 关闭所有图层?
- 或者我在这种情况下使用的任何其他技术?
I created on first frame menu.
On second frame there is all my game. I use button to change the frames:
button1.addEventListener(MouseEvent.MOUSE_DOWN, startGame1);
function startGame1(e:MouseEvent)
{
howManyPlayers = 1;
gotoAndStop(2);
}
But The frame 1 is still working and I can see it.
Is any possibility to:
- turn off/stop the frame 1
- turn off all layer?
- or any other technique which I use in this situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 ActionScript 3 将动画停止在时间轴中的某个帧非常简单,您所需要做的就是将此代码添加到您的帧中:
我最好的猜测是您没有“stop();”在你的第一帧上,动画只是从头开始循环播放帧,你想要它做的是停在你有“button1”的第一帧上,然后当你点击button1时,你想要动画跳转到第 2 帧,只需将其添加到第 1 帧中的代码中:
这样动画就会从“button1”所在的第 1 帧开始停止,然后当用户单击按钮时,它会跳转到代码示例中,然后转到第 2 帧并停止,如果不停止,有时可能会发生这种情况,只需添加另一个:stop();也在你的框架 2 上。
to stop the animation at a certain frame in the timeline with actionScript 3 is very simple, all you need to do is to add this code to your frame :
my best guess is that you don't have a "stop();" on your first frame and the animation simply starts playing from the begining looping through the frames, what you want it to do is to stop on the first frame where you have your "button1" and then when you click the button1 you want the animation to jump to frame 2, just add this to your code in frame 1 :
this way the animation is stopped from the begining on frame 1 where you have your "button1" and then when the user clicks your button it jumps into your code example and it goes to frame 2 and stops, if it doen't stop, which sometimes may happen just add another: stop(); on your frame 2 also.