删除数组内的循环MC

时间:2009-10-28 10:05:30

标签: actionscript-3 arrays

如何通过removeChild删除movieclip,稍后清理数组以进行刷新?

for (var t:int=0; t<8; t++) {
            circlesArray[2][t].removeChild(MovieClip)
        }

1 个答案:

答案 0 :(得分:0)

好的,你有一个包含圆圈动画片段的circlesArray?假设动画片段被添加到舞台上,那么:

for (var t:int=0;t<8;t++)
{
   removeChild(circlesArray[2][t]);
   //if they were added to some other movieclip then you would go
   //someOtherMovieClip.removeChild(circlesArray[2][t]);
}

如果你想清除整个阵列,那么只需

circlesArray.length = 0;

这将清除整个数组,但您可能不希望这样,因为您的多维数组中似乎有其他数据。