# Code not working need help

**URL:** <https://forum.kirupa.com/t/code-not-working-need-help/24994>\
**Category:** flash\
**Created:** [July 8, 2003, 5:19am UTC](https://forum.kirupa.com/t/code-not-working-need-help/24994 "2003-07-08T05:19:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DariusMonsef](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@DariusMonsef](https://forum.kirupa.com/u/DariusMonsef)\
**Post date:** [July 8, 2003, 5:19am UTC](https://forum.kirupa.com/t/code-not-working-need-help/24994/1 "2003-07-08T05:19:14Z")

</div>

[AS]  
for (i=1; i\<30; i++) {  
duplicateMovieClip(“word”, ‘word’+i, i);  
trace(i)  
}  
[/AS]

It spits out the right numbers, but I don’t get 30 MC on my screen.

any ideas??

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2003, 5:31am UTC](https://forum.kirupa.com/t/code-not-working-need-help/24994/2 "2003-07-08T05:31:59Z")

</div>

[AS]for (i=1; i\<=30; i++) {  
word.duplicateMovieClip(“word”+i, i);  
trace(i)  
}[/AS]

Try that.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2003, 5:35am UTC](https://forum.kirupa.com/t/code-not-working-need-help/24994/3 "2003-07-08T05:35:04Z")

</div>

This might be a dumb question, but does this code need to be on the MC that it is dupping, or in an onload or something

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2003, 5:49am UTC](https://forum.kirupa.com/t/code-not-working-need-help/24994/4 "2003-07-08T05:49:02Z")

</div>

It needs to be on a frame. The mc that is being duplicated needs to be on the stage and have the instance name “word” (no quotes)

[edit]Also keep in mind your current script as is just duplicates each clip and puts it in the original location, so that will just end up giving you a stack of duplicated clips and you won’t be able to visually see all 30 clips[/edit]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2003, 6:00am UTC](https://forum.kirupa.com/t/code-not-working-need-help/24994/5 "2003-07-08T06:00:12Z")

</div>

good point lost =)

do this

```auto
for (i=1; i<=30; i++) {
var clip = word.duplicateMovieClip("word"+i, i);
clip._x = Math.random(Stage.width)
clip._y = Math.random(Stage.height)
}

```

🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2003, 8:19am UTC](https://forum.kirupa.com/t/code-not-working-need-help/24994/6 "2003-07-08T08:19:42Z")

</div>

Thanks for the great help.

Ahmed, I ahd to remove the math. to get it to work, but thanks.
