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?