# Duplicating MCs

**URL:** <https://forum.kirupa.com/t/duplicating-mcs/16752>\
**Category:** Uncategorized\
**Created:** [March 28, 2003, 1:22am UTC](https://forum.kirupa.com/t/duplicating-mcs/16752 "2003-03-28T01:22:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![morse](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@morse](https://forum.kirupa.com/u/morse)\
**Post date:** [March 28, 2003, 1:22am UTC](https://forum.kirupa.com/t/duplicating-mcs/16752/1 "2003-03-28T01:22:56Z")

</div>

```auto
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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 28, 2003, 5:24pm UTC](https://forum.kirupa.com/t/duplicating-mcs/16752/2 "2003-03-28T17:24:20Z")

</div>

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
