# duplicateMC, removeMC ---?--- FMX

**URL:** <https://forum.kirupa.com/t/duplicatemc-removemc-fmx/5091>\
**Category:** Uncategorized\
**Created:** [August 31, 2002, 9:40am UTC](https://forum.kirupa.com/t/duplicatemc-removemc-fmx/5091 "2002-08-31T09:40:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![andr\_in](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/andr_in/32/37_2.png) [@andr\_in](https://forum.kirupa.com/u/andr_in)\
**Post date:** [August 31, 2002, 9:40am UTC](https://forum.kirupa.com/t/duplicatemc-removemc-fmx/5091/1 "2002-08-31T09:40:04Z")

</div>

Somebody posted an effect like that in the old forums… but I don’t know who it was(I know that his nick started wih “d”)  
here goes:  
I have a movieclip following the mouse.  
I want to duplicate it. So there would be like trail following the mouse (duplicateMovieclip)  
But I don’t want then to be more that 50! (removeMovieClip)  
How do I make it so?

---

<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:** [August 31, 2002, 9:51am UTC](https://forum.kirupa.com/t/duplicatemc-removemc-fmx/5091/2 "2002-08-31T09:51:54Z")

</div>

what i do is that i have an animation that gradualy fades out and then has a removeMovieClip at the end in the movie clip…so this way you duplicate it then it slowly fades and disapears

Probably not the most advanced way but it works for me

the code you would need for duplicate is

```php
onClipEvent(mouseMove){
duplicateMovieClip(_root.myMC,"myMC"+i,i);
++i;
}

```

Ok that should work 🙂

---

<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:** [August 31, 2002, 11:20am UTC](https://forum.kirupa.com/t/duplicatemc-removemc-fmx/5091/3 "2002-08-31T11:20:14Z")

</div>

hmm… Why didn’t I think of that?  
actually I was just looking for the removemovieclip action stuff but I wanted to be sure… thx!

---

<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:** [August 31, 2002, 11:38am UTC](https://forum.kirupa.com/t/duplicatemc-removemc-fmx/5091/4 "2002-08-31T11:38:03Z")

</div>

hmh… solving that problem causes another!  
I was making radnom smooth movement with a trail. It worked fine until I added this: (the bold)

```auto

onClipEvent (load) {
	MovieClip.prototype.newpos = function() {
		_root.newx = random(1024);
		_root.newy = random(768);
	};
	newpos();
}
onClipEvent (enterFrame) {
	**duplicateMovieClip(_root.ss.circle, "circledup"+d, d);
	d++;**
	_root.xpos = this._x;
	_root.ypos = this._y;
	_root.ss.circle._x += (_root.newx-_root.xpos)/10;
	_root.ss.circle._y += (_root.newy-_root.ypos)/10;
	if ((_root.xpos>=_root.newx-10) and (_root.xpos<=_root.newx+10) and (_root.ypos>=_root.newy-10) and (_root.ypos<=_root.newy+10)) {
		newpos();
	}
	d++;
}

```

It worked fine… a circle moved smoothly from one point to another, but when I put this code there it started … I don’t know what to call it!  
I zipped and attached the fla (it’s without the duplicateMC code, you can add it yourself to see what happens)  
Any help would be greatly appreciated :-\

---

<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:** [August 31, 2002, 11:41am UTC](https://forum.kirupa.com/t/duplicatemc-removemc-fmx/5091/5 "2002-08-31T11:41:07Z")

</div>

Oops here’s the .fla  
(forgot to attach :))

---

<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:** [September 1, 2002, 8:38am UTC](https://forum.kirupa.com/t/duplicatemc-removemc-fmx/5091/6 "2002-09-01T08:38:21Z")

</div>

ur problem is that when u duplicate the movie clip you are also duplicating the actions that go with it…or at least that what i think it is 🙂

---

<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:** [September 1, 2002, 2:04pm UTC](https://forum.kirupa.com/t/duplicatemc-removemc-fmx/5091/7 "2002-09-01T14:04:29Z")

</div>

Works like a charm!  
Thanx Bezzer! :):)🙂
