# Duplicate problem

**URL:** <https://forum.kirupa.com/t/duplicate-problem/222615>\
**Category:** Uncategorized\
**Created:** [April 15, 2007, 11:44am UTC](https://forum.kirupa.com/t/duplicate-problem/222615 "2007-04-15T11:44:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![woopsedoo](https://avatars.discourse-cdn.com/v4/letter/w/a87d85/32.png) [@woopsedoo](https://forum.kirupa.com/u/woopsedoo)\
**Post date:** [April 15, 2007, 11:44am UTC](https://forum.kirupa.com/t/duplicate-problem/222615/1 "2007-04-15T11:44:05Z")

</div>

im trying t make a simple effect. what i want to do is when you moev the mouse a duplicate of a ball is made to the position of the mouse and then it falls down towards the bottom of the screen. my problem is that i cant figure out the code to get all of my duplicate balls falling down at once. im not sure whether it needs a for function but im not really sure on what that is. my code is this :

```auto

i = 1;
onMouseMove = function () {
 i = i+1;
 duplicateMovieClip(_root.ball, "ball"+i, i+1);
 _root["ball"+i]._x = _root._xmouse;
 _root["ball"+i]._y = _root._ymouse;
 onEnterFrame = function () { _root["ball"+i]._y += 10;};
};

```

any help is appreciated  
thanks  
woopsedoo
