# Help with hitTestObject

**URL:** <https://forum.kirupa.com/t/help-with-hittestobject/296336>\
**Category:** flash\
**Created:** [September 13, 2009, 8:54pm UTC](https://forum.kirupa.com/t/help-with-hittestobject/296336 "2009-09-13T20:54:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Obi\_Wan](https://avatars.discourse-cdn.com/v4/letter/o/e99b99/32.png) [@Obi\_Wan](https://forum.kirupa.com/u/Obi_Wan)\
**Post date:** [September 13, 2009, 8:54pm UTC](https://forum.kirupa.com/t/help-with-hittestobject/296336/1 "2009-09-13T20:54:49Z")

</div>

Hey everyone I have a problem with my hitTestObject, and I was wondering if someone was  
cool enough to tell me what I am doing wrong.

```auto

      public function getBoundryObjetcs ():void
      {
         boundryBlocks = new Array();
         // check number of children in environment that are boundry blocks
         for (var i:int = 0; i < environment.numChildren; i++) {
            // eo short for environment object
            var eo = environment.getChildAt(i);
            if (eo is boundryBlock) {
               // add to array and set visibility to false
               boundryBlocks.push (eo);
               eo.visible = true;
            }
         }
      }
      public function checkBoundryCollision ():void
      {
         for (var i:int = 0; i< boundryBlocks.length; i++) {
            var eo = environment.getChildAt(i);
            if (mobe.hitTestObject(boundryBlocks*)) {
               trace ("hello blocks");
               //environment.y+= 2;
               //environment.x+= 5;
            }
         }
      }

```
