# Need help with "for" loop

**URL:** <https://forum.kirupa.com/t/need-help-with-for-loop/181765>\
**Category:** flash\
**Created:** [March 12, 2006, 10:13pm UTC](https://forum.kirupa.com/t/need-help-with-for-loop/181765 "2006-03-12T22:13:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brikko](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brikko](https://forum.kirupa.com/u/brikko)\
**Post date:** [March 12, 2006, 10:13pm UTC](https://forum.kirupa.com/t/need-help-with-for-loop/181765/1 "2006-03-12T22:13:06Z")

</div>

In this game I’m making, I am trying to use a “for” loop to detect if a certain enemy (who is in a movieclip named “world”) is touching a stone wall (specifically called “blocker9”). This is the code I’m using:

```auto

for (e=1; e<180; e++) {
  theEnemy = world["enemy"+e];
  theBlocker = world["blocker"+e];
  if (theEnemy.hitTest(theBlocker)) {
   trace("hit");
  }
}

```

Whenever I put “world.blocker9” instead of “theBlocker”, it works. I don’t know why. Thanks for any help in advance. :hr:
