如何使在Flash CS5中一个普遍的暂停按钮?按钮、普遍、Flash

2023-09-09 21:28:37 作者:余生我只是路过

我试图让Flash中的某个按钮暂停所有在我的文件上运行的影片剪辑。所有这些影片剪辑都是在我的主时间轴补间,他们都有自己的个人时间安排。每一个移动的剪辑是一个按钮,告诉片段开始播放触发。所以,如果有人可以帮助我建立这个暂停键,我将不胜AP preciate它。感谢您的时间。

I am trying to make a button in Flash that pauses all of the movie clips that are running in my file. None of these movie clips are tweens in my main timeline, they all have their own individual timeline. Each move clip is triggered by a button that tells the clips to start playing. So, if anyone could help me create this pause button, I would greatly appreciate it. Thank you for your time.

推荐答案

下面应该做的伎俩:

// create an array to store all playing movieclips 
var playing = [];

// when a movieclip is played add it to the array like this:
// playing.push(myMovieClip);

// call this from your pause button's click handler
function pauseAll() 
{
    // loop through all the playing movieclips ...
    for (var i = 0; i < playing.length; i ++)
    {
        // ... and stop them
        playing[i].stop();
    }

    // now clear the array
    playing = [];
}