# Is there something wrong with my for loop?

**URL:** <https://forum.kirupa.com/t/is-there-something-wrong-with-my-for-loop/199549>\
**Category:** Uncategorized\
**Created:** [September 3, 2006, 10:18pm UTC](https://forum.kirupa.com/t/is-there-something-wrong-with-my-for-loop/199549 "2006-09-03T22:18:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eclectrik](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@eclectrik](https://forum.kirupa.com/u/eclectrik)\
**Post date:** [September 3, 2006, 10:18pm UTC](https://forum.kirupa.com/t/is-there-something-wrong-with-my-for-loop/199549/1 "2006-09-03T22:18:37Z")

</div>

The Code below on displays item11 a.k.a LINKS and only the 11th attachment, and none others , what is wrong ? i cant find it.

```auto
 
 
#include "lmc_tween.as"
//Callback Function for lacos to tell when to rescale/alpha back to 100 percent
 function reScale() {
 //Loop from i = 0 to i = 12;
 for (var i:Number = 0; i <=12; i++)
 {
 //Target the i'th movie clip;
  var mc:MovieClip =path;
  //Calculate the delay required;
  var delay:Number = i / 5;
  //Make the calls to the functions;
  mc.scaleTo(100, 2, "easeOutElastic", delay);
  mc.alphaTo(100, 2, "linear", delay);
 }
}
//Headers
_global.txt = ["GAMES", "BLOG", "GIRLFRIEND", "BOOKS", "SCHOOL", "FOOD","PORTFLIO","FRIENDS","DOWNLOADS","ACCOLADES","CONTACT","LINKS"];
//Starting position in the X axis
var startX = 160;
//Starting position in the Y axis
var startY = 195;
//Pixels between each box
var sep = -5; 
//How many boxes per row.
var colSize = 5;
//How many rows (based on the links and colSize)
var rowSize = Math.floor(txt.length/colSize);
var count = 1;
for(var y = 0; y < rowSize; y++) {
 for(var x = 0; x < colSize; x++) {
  attachMovie("box", "b" + count, count);
  var path = _root["b" + count];
  count++;
  path.id = count;
  path.alphaTo(0,0,null);
  path.txt.text = txt[count]
  path.scaleTo(0,0.2,"easeoutElastic",0.1,reScale);
 
  //Setup the boxes position on the screen
  path._x = startX + (x * (path._width + sep));
  path._y = startY + (y * (path._height + sep));
 
 }
}

```
