|
|
|
#1 |
|
Senior Member
Join Date: Jul 2001
Posts: 198
|
duplicate movie clips for multiple MC's
I need to duplicate several MC's (each one x 20) when he movie is loaded.
I can't get it to work for the life of me.... Any ideas? Thanks ~fit this code resides in _root.MC and the first frame ================================================== == count = 0; function dup1() { while (count<20) { circle.duplicateMovieClip("circle"+count, count); count++; } } count2 = 0; function dup2() { while (count2<20) { circle2.duplicateMovieClip("circle2"+count2, count2); count2++; } } dup1(); dup2(); ================================================== = Only duplicates the circle2. If I don't initiate the 2nd func (dup2();...it works for circle...and visa/versa????????? Can you NOT do duplicate movies for multiple MC's?? |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Feb 2004
Location: Los Angeles
Posts: 2,920
|
The problem is the depth of the movies you are duplicating (the 2nd parameter).
You can only have one movieclip at a particular depth. If you try to put a second movieclip at the same depth, it obliterates the first one. To fix, in your dup2 code, change this line: circle2.duplicateMovieClip("circle2"+count2, count2); to this: circle2.duplicateMovieClip("circle2"+count2, count2 + 20); so the second set of movies go to unique depths. It's also worth mentioning that you could use a single function that accepts parameters, and reduce the amount of code by half. For example:
|
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|