下面的程式是檢查第N個的影片是否有"單獨"跑完才跑下一個影片,是一個接著一個慢慢跑的程式但是我想問如果同時複製N個影片想要讓"這一批"同時跑完之後再跑下一批N個影片的話要如何修改呢?譬如:第一次先跑1個圓圈等跑完之後換下一批
第二次跑2個圓圈之後再跑下一批
第三次跑3個圓圈之類
論壇開啟了防盜鏈,請點選瀏覽該FLASH文件以下內容為程序代碼:
1 var nextmc = 1;
2 var played = 1;
3 var count = 1;
4 while (count<=10) {
5 this.attachMovie("mc", "nextmc"+count, this.getNextHighestDepth(), {_y:40*count});
6 count++;
7 // 複製到第十個開始播放
8 if (count == 10) {
9 // 用迴圈檢查目標mc是某播放完畢
10 onEnterFrame = function () {
11 this["nextmc"+played].play();
12 // 用播放格式來檢查有沒播放完畢
13 if (this["nextmc"+played]._currentframe == this["nextmc"+played]._totalframes) {
14 trace("第一個 "+played+" 結束");
15 this["nextmc"+played].stop();
16 // 累加或結束迴圈
17 (played == 10) ? delete this.onEnterFrame : played++;
18 }
19 };
20 }
21 }