# \[fmx\] FOR Loops and Function Question

**URL:** https://forum.kirupa.com/t/fmx-for-loops-and-function-question/71413
**Category:** flash
**Created:** [November 24, 2004, 4:24pm UTC](https://forum.kirupa.com/t/fmx-for-loops-and-function-question/71413 "2004-11-24T16:24:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jupiter](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jupiter/32/827_2.png) [@jupiter](https://forum.kirupa.com/u/jupiter)
#### Post date: [November 24, 2004, 4:24pm UTC](https://forum.kirupa.com/t/fmx-for-loops-and-function-question/71413/1 "2004-11-24T16:24:25Z")

</div>

HI, why this code dosen´t work at the same time in the timeline, and why only envent put inside the attacHMovies or duplicated Movies work, if i put them in the forr loops they don´t work.

Thanks people

```auto
  
img01 = new Array();
img01 = ["001.jpg", "002.jpg", "003.jpg", "004.jpg", "005.jpg", "006.jpg", "007.jpg", "008.jpg", "009.jpg"];
for (i=1; i<=img01.length; i++) {
 newclip = _root.content1.attachMovie("holder", "newclip"+i, i);
 newclip._x = 0+x;
 newclip._y = 0;
 x += 109;
 //trace(i);
}
img02 = new Array();
img02 = ["001.jpg", "002.jpg", "003.jpg", "004.jpg", "005.jpg", "006.jpg", "007.jpg", "008.jpg", "009.jpg"];
for (j=10; j<=19; j++) {
 newclip2 = _root.content2.attachMovie("holder", "newclip2"+j, j);
 newclip2._x = 0+x;
 newclip2._y = 100;
 x += 109;
 trace("j "+j);
 trace(newclip2._y);
}
 

```
