PDA

View Full Version : duplicating MCs



morse
March 27th, 2003, 08:22 PM
onClipEvent (enterFrame) {
for (i=0; i<3; i++) {
if (this.hitTest(_root["person"+i])) {
gore = Math.floor(Math.random()*3);
index++;
_root["blood"+gore].duplicateMovieClip("pile"+index, index);
_root["pile"+index]._x = _root["person"+i]._x;
_root["pile"+index]._y = _root["person"+i]._y;
this.removeMovieClip();

}
}
}
When it hits the person the "pile" is created, but when another is created the old one disapears. Hence, you only have one and it moves around. How can I fix this so that each time a new one is created and it just stays there?

eyezberg
March 28th, 2003, 12:24 PM
duplicateMovieClip("pile"+index, index);
"pile"+index = the name
index=the depth!

do a trace on that to check if it changes, coz if not, same depth means one clip replaces the previous..

blood? gore? whatcha into? lol