hitTest returning undefined

i’m making a game at the moment, with tank and planes where you have to shoot down enemy planes that fly overhead, and blow up tanks that follow you.

i’ve written functions to create the planes and tanks, and in these functions it adds the name of the movieclip that has been added to the array, so that the bullets can cycle through each bit of the array and get all of the names of the enemy planes/tanks and hitTest with them to see if it shpould blow them up.

here’s what i’ve got:


bullet.prototype.onEnterFrame = function() {
//...
for (j in enemyHandle) {
			this.currentTest = enemyHandle[j]; //enemyHandle is the array that stores the names of the enemy movieclips
			if ([this.currentTest].hitTest(this._x, this._y, true) && [this.currentTest].class == "enemy") {
				[this.currentTest].die();
				trace("hit");
			}
		}
//...
}

[this.currentTest].hitTest(this._x, this._y, true)
returns undefined, and i can’t figure out why.

thanks in advance. :slight_smile: