PDA

View Full Version : Duplicate MC question



Uli
February 18th, 2004, 12:12 PM
Hello,
I'm using a loop to duplicate a MC named MCbutton, which is all good.


for (i=1; i<=this.total; i++) {_root.MCbutton.duplicateMovieClip(["MCtest"+i], 1+i);
trace(_root.MCtest1);
//_level0.MCtest1
}


but why isn't this one working??


for (i=1; i<=this.total; i++) {_root.MCbutton.duplicateMovieClip(_root.someClip["MCtest"+i], 1+i);
trace(_root.someClip.MCtest1);
//undefined
}


Can't i duplicate a Clip inside another Clip??

Voetsjoeba
February 18th, 2004, 12:15 PM
movieclip.duplicateMovieClip(newname,depth);

You are setting it's name equal to the path of _root.someClip["MCtest"+i]. The movieclip will not be copied inside _root.someClip.

Uli
February 18th, 2004, 12:37 PM
Thanks for your reply, but is it possible then to duplicated inside another MC ???

Voetsjoeba
February 18th, 2004, 12:56 PM
You would simply have to place MCButton in _root.someClip as well. Then it can be duplicated in that movie too. I don't know of any way to duplicate a movieclip to another movieclip, sorry.

Uli
February 18th, 2004, 01:15 PM
That did the trick, thanks for your reply :)

Voetsjoeba
February 18th, 2004, 01:21 PM
You're welcome :)