I am making a game where one object needs to hit test many so I have been trying to build it like so:
function HitTester() {
trace("calling function");
for (i=0; i<12; i++) {
_global.CometArray.push(_root["comet"+i+"_mc"]);
temp_A = eval(_global.CometArray);
if (bottomHit_mc.hitTest(temp_A)) {
trace("WOOOO");
}
}
}
and to active it:
bottomHit_mc.onEnterFrame = function() {
HitTester();
}
But this doesn’t seem to work and as the enterFrame calls in the function so many times it is really slowing everything down.
Can anyone tell me where I am going wrong or a better way of doing it?
Thanks!