# Duplicate movie clip problem. Please help!

**URL:** https://forum.kirupa.com/t/duplicate-movie-clip-problem-please-help/331995
**Category:** flash
**Created:** [December 21, 2013, 5:27pm UTC](https://forum.kirupa.com/t/duplicate-movie-clip-problem-please-help/331995 "2013-12-21T17:27:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![neerav1992](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@neerav1992](https://forum.kirupa.com/u/neerav1992)
#### Post date: [December 21, 2013, 5:27pm UTC](https://forum.kirupa.com/t/duplicate-movie-clip-problem-please-help/331995/1 "2013-12-21T17:27:02Z")

</div>

I created a circle movie clip (movie clip name: enemy, instance name: enemy\_inst) and typed this in the first frame:

var i:Number;  
for (i=1; i\<=5; i++)  
{  
enemy\_inst.duplicateMovieClip(enemy\_inst, “enemy\_inst”+i, i);  
}

I’m trying to generate 5 duplicates of the same movie clip here. And in the action script box of the original instance, ie, ‘enemy\_inst’, I typed:

onClipEvent(load)  
{

```
  this._x=500;
  this._y= random(400);
  this.z=random(10)+1;

```

}

onClipEvent(enterFrame)  
{  
this.\_x-=z;  
}

So that I could see 6 different instances of the movie clip (including the original) move across the screen at varying speeds and at varying points on the y axis.

But no matter what I do, I only see 2 instances of the movie clip when I play the movie. They appear at different points on the y axis and move across the screen at different speeds like I wanted. I even tried changing the loop condition from i\<=5 to i\<=100. Still, I only see 2 instances of the movie clip. One of those instances is the original one, so that means the for loop in the first frame is running only once. Since I generate a new y value on load for each instance of the movie clip, that eliminates the possibility of overlapping. I can’t find anything wrong with the code either. Please help. (I’m new to flash, btw)
