Deleting mc's

i have a button that duplicates mc’s; the code is:


on (press) {
i = i + 1;
duplicateMovieClip (ce, “ce” + i, i);//ce is the mc name
}

i have another button that i want to delete those duplicates; the code is:


on (release) {
while (count >= 0){
removemovieclip(_root.ce + i);
var count;
count= count+1;
}
}

But this last code doesnt work at all
How can i improve it?
this last code was inspired from here:
www.macromedia.com/suppor…e_clip.htm

(but i dont understand it at all)

it should be:
removeMovieClip(_root[“ce”+i]);

:slight_smile:
jeremy

sorry but doesnt work either…

that’s the code for it… that’s for sure. If I were you I’d go back and check my syntax.

  1. Make sure every { has an ending }
  2. Make sure all your contained lines end with ;
  3. Use the debug mode when doing a test.
  4. Try using “trace” to trace variables during testing to make sure that they seem to reflect what it is you’re programing.

If I can think of any other debuging rules of thumb I’ll let you know. Short of that you’ll probebly have to send the file to someone, or provide more of the script from various areas of the movie

try changing your duplication script to :
duplicateMovieClip(ce, _root[“ce”+i], i);
then add the removeMovieClip suggested by sinfiniti