加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

如何在Flash CS5中制作通用暂停按钮?

发布时间:2020-12-15 07:24:13 所属栏目:百科 来源:网络整理
导读:我试图在Flash中创建一个按钮,暂停我文件中运行的所有影片剪辑.这些影片剪辑中没有一个是我主时间轴中的补间,它们都有各自的时间轴.每个移动剪辑都由一个按钮触发,该按钮告诉剪辑开始播放.所以,如果有人可以帮我创建这个暂停按钮,我将非常感激.感谢您的时间.
我试图在Flash中创建一个按钮,暂停我文件中运行的所有影片剪辑.这些影片剪辑中没有一个是我主时间轴中的补间,它们都有各自的时间轴.每个移动剪辑都由一个按钮触发,该按钮告诉剪辑开始播放.所以,如果有人可以帮我创建这个暂停按钮,我将非常感激.感谢您的时间.

解决方法

以下应该做的伎俩:

// 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 = [];
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读