# Why one "for" loop working, other not?

**URL:** <https://forum.kirupa.com/t/why-one-for-loop-working-other-not/304276>\
**Category:** flash\
**Created:** [February 4, 2010, 7:03pm UTC](https://forum.kirupa.com/t/why-one-for-loop-working-other-not/304276 "2010-02-04T19:03:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m2244](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@m2244](https://forum.kirupa.com/u/m2244)\
**Post date:** [February 4, 2010, 7:03pm UTC](https://forum.kirupa.com/t/why-one-for-loop-working-other-not/304276/1 "2010-02-04T19:03:12Z")

</div>

Why does the first loop work but not the other?

```auto
 
for (var i:uint =0; i<8; i++)//This one works.
{
 this["popUp" + i].addEventListener(MouseEvent.CLICK, handleClick);
 this["popUp" + i].buttonMode = true;
 this["popUp" + i].mouseChildren = false;
 this["popUp" + i].useHandCursor = true;
}
 
for (var n:uint = 0; i<8; i++)//This one does not work.
{
 this["popUp" + n + "hl"].visible = false;
 /*popUp0hl.visible = false;
 popUp1hl.visible = false;
 popUp2hl.visible = false;
 popUp3hl.visible = false;
 popUp4hl.visible = false;
 popUp5hl.visible = false;
 popUp6hl.visible = false;
 popUp7hl.visible = false;*/
}

```
