Remove movieclips from Array- Important Classes for games in AS 3.0

December 22nd, 2011 by aabhaanjan

images

[xml]
package
{

import flash.display.MovieClip;
/**
* …
* @description : This Class can be used when you need to remove all movieclips from its stored array.
* @author Aava Rani
*/
public class RemoveMovieClipsFromArrayClass extends MovieClip
{

public function RemoveMovieClipsFromArrayClass():void
{
trace(‘ Constructor called ‘);
}

public function removeAllMovieClipsFromArray(__clipArray:Array):void {
for (var __i:int = __clipArray.length – 1; __i >= 0 ; __i– ) {
removeChild(__clipArray[__i])
__clipArray.splice(__i, 1);
}
}

}

}
[/xml]