# Duplicate movieclip naming problem. as2

**URL:** https://forum.kirupa.com/t/duplicate-movieclip-naming-problem-as2/316469
**Category:** programming
**Created:** [November 22, 2010, 10:55pm UTC](https://forum.kirupa.com/t/duplicate-movieclip-naming-problem-as2/316469 "2010-11-22T22:55:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Mr\_Pancake](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mr\_Pancake](https://forum.kirupa.com/u/Mr_Pancake)
#### Post date: [November 22, 2010, 10:55pm UTC](https://forum.kirupa.com/t/duplicate-movieclip-naming-problem-as2/316469/1 "2010-11-22T22:55:49Z")

</div>

So yeah, i’m making a game again. there’s a problem tho. I need the generated enemies to be called enemy1 enemy2 enemy3 and so on.

the code returns enemy0 every single time “maker” is executed. what am i doing wrong here? D:

```
Code:

```

```auto
laufen = "enemy"+i;

function maker() {
    duplicateMovieClip("enemy", "enemy"+i, _root.getNextHighestDepth());
    trace(laufen);
}
ID = setInterval(maker, 1000);

```

Yes enemy is on the stage and is being duplicated.
