如何使在Flash CS5中一个普遍的暂停按钮? [英] How to make a universal pause button in Flash CS5?

查看:152
本文介绍了如何使在Flash CS5中一个普遍的暂停按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让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 = [];
}

这篇关于如何使在Flash CS5中一个普遍的暂停按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆