man this site is awsome, i have learned so much. but unfortunantly i have run into a new problem. i have
for (f=0; f<10; f++) {
duplicateMovieClip(_root.guy, “guy”+f, f);
}
for (s=0; s<50; s++) {
duplicateMovieClip(_root.otherguy, “otherguy”+s, s);
}
for (l=0; l<40; l++) {
duplicateMovieClip(_root.star, “star”+l, l);
}
only problem is, is that when the movies get duplicated, the numbers aren’t right (ive done some testing and found that it is almost as if it is keeping the same variable in all the loops as the same, and is running the loops backwards (wierd)) anyways, apparently i dont know the for loop as good as i thought. i have tried rereading the for explenation, but nothin is clicking as to what i am doing wrong. any help or explenation would be great.
(also, as a side question/statement-when i duplicate movieclips, they dont keep thier instante name in the duplicated ones, which is bad becuase i need to do hitTest and other things with the duplicated movieclips. any help with this would be great)
ahh… at first I was confused… then in a blinding flash of light I saw the answer. Funny how the simplest things can often elude us.
In each for loop you are setting the letter to 0… in the depth argument, you’re setting the object to the depth of the letter. So when your second for loop fires it sets it’s first duplicate to depth 0 which will delete the dup that you made in your first loop.
What you need is a variable called vDepthCount or something like that. Then your code would look something like this
holy mc awsome, THANKS… you guys are all truly awosme to the max. i cant belive i messed up like that. what can i say, kirupa has the best of the best.
would you guys have anyidea what to do about my second question about instace names on duplicated movieclips… but hey, i happy with just what you guys have told me so far. man you guys are cool.