2009-10-28 57 views
0

如何通過removeChild刪除動畫片段並稍後清理陣列以進行刷新?刪除陣列內部的循環MC

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

回答

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; 

這將清除整個數組,但你可能不希望這樣,因爲你似乎在多維數組中有其他數據。