Remove Movie Clips

Hi

How do I remove ALL movieclips on the stage?

the´ve been created thru DuplicateMovieClip action.

thanks

hmm…if you duplicate them inside one empty movieclip, you will only need to remove that movieclip…

or you can use a for cicle… dunno

Was not inside a movieclip. Was on the stage. i thought about creating them inside a mc, but it´s not possible in that case.

for cicle?

[QUOTE=pantas;2350231]for cicle?[/QUOTE]

didnt get it :frowning:

hey felipegm,

as you create the clips using duplicateMovieClip( ), push them into an array using the .push method. then when you want to remove the clips simply loop through the array and do so. lastly, splice the array at the 0 position to delete the references in memory that correspond the removed clips. code is below.

// create an array
var yourArray:Array = [];

// duplicate your clip
yourClip.duplicateMovieClip(“newClipName”, _root.getNextHighestDepth());

// push the new clip to the end of the array
yourArray.push(newClipName);

// delete the clips on stage
for(var i:Number = 0; i < yourArray.length; i++)
{

yourArray*.removeMovieClip( );

};

// now remove the old data from the array
yourArray.splice(0);