# For() statement, cant see where i am going wrong

**URL:** <https://forum.kirupa.com/t/for-statement-cant-see-where-i-am-going-wrong/191566>\
**Category:** Uncategorized\
**Created:** [June 21, 2006, 12:11pm UTC](https://forum.kirupa.com/t/for-statement-cant-see-where-i-am-going-wrong/191566 "2006-06-21T12:11:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul\_ferrie](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@paul\_ferrie](https://forum.kirupa.com/u/paul_ferrie)\
**Post date:** [June 21, 2006, 12:11pm UTC](https://forum.kirupa.com/t/for-statement-cant-see-where-i-am-going-wrong/191566/1 "2006-06-21T12:11:05Z")

</div>

Not sure whats going on. Information sent back from database is correct so it must be my for statement.

```auto

var nextY = 0;
var nextY2 = 18;
for (var count = 0; count < result_lv.typeCount; count++) {
 var nextY2 = 18;
 holder.attachMovie("header", "type" + count, count);
 holder["type" + count]._y = nextY;
 holder["type" + count].txTitle.text = result_lv["type" + count];
 for (var counter = 0; counter < result_lv["type" + count + "clientCount"]; counter++) {
  holder["type" + count].attachMovie("client", "cl" + counter, counter);
  holder["type" + count]["cl" + counter]._y = nextY2;
  holder["type" + count]["cl" + counter]._x = 200;
  holder["type" + count]["cl" + counter].txTitle.text = result_lv["cl" + counter + "projName"];
  nextY2 += Math.ceil(holder["type" + count]["cl" + counter]._height + 2);
  trace("project title=" + result_lv["cl" + counter + "projName"]);
 }
 nextY += Math.ceil(holder["type" + count]._height + 2);
}

```

there are 3 sub categorys:  
cd/dvd  
www/html  
www/flash  
These load fine.  
the problem starts in the second for(). For some strange reason every category has the first 2 same projects.  
The count for each category project count is correct.  
But it would seem that each category want to load every project regardless of the category that it should be in.  
i can post php output if need.  
THanks for any help
