# Multiple mc spawning

**URL:** https://forum.kirupa.com/t/multiple-mc-spawning/313623
**Category:** flash
**Created:** [September 5, 2010, 2:39am UTC](https://forum.kirupa.com/t/multiple-mc-spawning/313623 "2010-09-05T02:39:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pizzadude223](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@pizzadude223](https://forum.kirupa.com/u/pizzadude223)
#### Post date: [September 5, 2010, 2:39am UTC](https://forum.kirupa.com/t/multiple-mc-spawning/313623/1 "2010-09-05T02:39:55Z")

</div>

I read a bunch of tutorials and I cant get multiple mc’s to spawn. I have this button so that when you click it, it spawns an mc that you can drag around. So I spawn one drag it around, then try to spawn another but that deletes the old one and makes a new one. Here is my code:

```auto

on(release){
 var i;
 i++;
 var newname = "bullet"+i;
 _root.attachMovie("bullet", newname, i*100);
 _root[newname]._y = _root.hero._y+13;
 _root[newname]._x = _root.hero._x+55;
 _root[newname].onEnterFrame = function() {
  if (this._x>555) {
   this.removeMovieClip();
  }
 }
}

```

Thanks for any help.
