I read the tutorial about Multiple Object Collision Detection. What I want to do
is have there be 3 circles and 3 squares. the circles are moving randomly while the squares are stationary. The actionscript would need to be checking to see whenever the moving
circles collide with the stationary squares. However, it doesn’t seem to be working. I followed the logic of the tutorial pretty closely, by making a separate list for the instance names. Here is the code for the collision detection. Thanks for any help!
target_mc = [ “circle0”, “circle1”, “circle2”];
target_mc2 = [ “square3”, “square4”, “square5”];
//
hitTester = function () {
numCircles = target_mc.length;
numCircles2 = target_mc2.length;
for (i=0; i<numCircles; i++) {
circleA = target_mc*;
for (j=i+1; j<numCircles2; j++) {
circleB = target_mc2[j];
temp_A = eval(circleA);
temp_B = eval(circleB);
if (temp_A.hitTest(temp_B)) {
// Your code
dirChanger(temp_A, temp_B);
//
}
}
}
};
this.onEnterFrame = function() {
hitTester();
};