简体   繁体   English

单击按钮时Flash AS2播放/停止动画片段

[英]Flash AS2 play/stop movieclip on Button click

So i have a button. 所以我有一个按钮。 On click it does this 点击它执行此操作

on (release) {
gotoAndstop (91)}

on frame 91 i have a movieclip. 在第91帧上,我有一个动画片段。

And inside the movieclip i've used stop(); 在动画片段中,我使用了stop(); to stop the animation from repeating. 阻止动画重复。 But when i click on the button again. 但是当我再次单击按钮时。 It wont animate. 它不会动画。 Its stopped permanently. 它永久停止了。

I want to be able to keep clicking on the button so it runs the animation only once. 我希望能够继续单击该按钮,以便它只运行一次动画。

What do i do? 我该怎么办?

THanks! 谢谢!

That's the expected behaviour. 那是预期的行为。 The movieclip is at frame 91 and stays there when you use gotoAndStop(91), nothing changes, so nothing restarts and no frame scripts will be executed. 影片剪辑位于第91帧,并且在使用gotoAndStop(91)时停留在该位置,因此没有任何变化,因此没有任何重启,因此不会执行任何帧脚本。

If you want to control the inner movieclip, you need to give it an instance name and then use instanceName.play() or instanceName.gotoAndPlay() on it to restart the animation. 如果要控制内部动画片段,则需要为其指定一个实例名称,然后在其上使用instanceName.play()或instanceName.gotoAndPlay()重新启动动画。 Make sure the instance is already available when you try to control it. 尝试控制实例时,请确保该实例已经可用。

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

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