PDA

View Full Version : deleting mc's



rs2002
April 1st, 2002, 05:35 PM
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 (http://www.macromedia.com/support/flash/ts/documents/random_movie_clip.htm)

(but i dont understand it at all)

sinfiniti
April 1st, 2002, 05:48 PM
it should be:
removeMovieClip(_root["ce"+i]);

:)
jeremy

rs2002
April 1st, 2002, 06:18 PM
sorry but doesnt work either...

upuaut8
April 1st, 2002, 10:47 PM
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

thoriphes
April 1st, 2002, 11:08 PM
try changing your duplication script to :
duplicateMovieClip(ce, _root["ce"+i], i);
then add the removeMovieClip suggested by sinfiniti