# Hit test and arrays

**URL:** <https://forum.kirupa.com/t/hit-test-and-arrays/307419>\
**Category:** Uncategorized\
**Created:** [April 2, 2010, 11:33pm UTC](https://forum.kirupa.com/t/hit-test-and-arrays/307419 "2010-04-02T23:33:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackout188](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@blackout188](https://forum.kirupa.com/u/blackout188)\
**Post date:** [April 2, 2010, 11:33pm UTC](https://forum.kirupa.com/t/hit-test-and-arrays/307419/1 "2010-04-02T23:33:07Z")

</div>

```auto
stop();
var hitOK:Boolean;
hitOK = true
var dropedArray:Array = new Array();
var score:Number
score=0
score_txt.text=String(score)
for (var i:uint=0; i<1; i++) { //this line
var droped:MovieClip = new drop();
droped.x = Math.round(Math.random() * this.stage.stageWidth);
droped.y = Math.round(Math.random() * 100);
addChild(droped);
dropedArray.push(droped);
}
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void {
for (var i:uint=0; i<dropedArray.length; i++) {
  dropedArray*.y += 1;
  if (dropedArray*.y >this.stage.stageHeight){
   dropedArray*.y = 0;
   dropedArray*.x = Math.round(Math.random() * this.stage.stageWidth);
  }
dropedArray*.addEventListener(Event.ENTER_FRAME,hittest);
}

}
function hittest(e:Event){
//if (droped.hitTestObject(waterman)) {
if (droped.hitTestPoint(waterman.x, waterman.y,false)) {
  if (hitOK == true) {
  score++
  hitOK = false
  trace(score)
  //parent.removeChild(droped)
  score_txt.text=String(score)
  }
  
}
else {
  hitOK = true
  }
}

```

when ever my array is greater than 1, my hittest stop working, I don’t get why can someone tell me how to fix it?
