# How to duplicate moveclip automatically?

**URL:** <https://forum.kirupa.com/t/how-to-duplicate-moveclip-automatically/30448>\
**Category:** flash\
**Created:** [September 9, 2003, 2:12am UTC](https://forum.kirupa.com/t/how-to-duplicate-moveclip-automatically/30448 "2003-09-09T02:12:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nanny](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@nanny](https://forum.kirupa.com/u/nanny)\
**Post date:** [September 9, 2003, 2:12am UTC](https://forum.kirupa.com/t/how-to-duplicate-moveclip-automatically/30448/1 "2003-09-09T02:12:13Z")

</div>

Hello,

In my flash file, I have a movieclip called target and one button used to  
duplicate the target movieclip.

the actionscript of movieclip is  
[AS]  
onClipEvent (load) {

```
scale = (random(100) + 50)

this._x = random(550);
this._y = random(400);
this._alpha = random(100);
this._xscale = scale;
this._yscale = scale;

```

}  
[/AS]

[AS]  
the actionscript of button is  
i = i + 1;  
duplicateMovieClip (\_root.target, “target” + i, i);  
[/AS]

I would like to duplicate movieclip(target) automatically means I don’t have to press button to duplicate movieclip.

Any ideas?

I am really appreciate your help.
