Evening all, im having a really frustrating problem. I have 6 movieclips on the stage, all acting as ‘map areas’, these are named area1_mc, area2_mc and so on… I then have a car which i drive around the screen, this instance name is car_mc …
All i want to do is do a HitTest to determine if the car is on one of the 6 areas…
i have the following
function checkCarsPos(){
var mapAreas:Array = [area1_mc, area2_mc, area3_mc, area4_mc, area5_mc, area6_mc];
for (var i:int=0; i < mapAreas.length; i++)
{
if (mapAreas*.hitTestObject(car_mc)){
// Do nothing
trace ("on map");
} else {
// Loose a life etc.
trace ("off map");
}
}
}
The reason it is not working i think is it is expecting the car to be on ALL map areas in order for it to be “on map”. For example if the car is in the middle of area1_mc, i get three traces. On map (refferign to it being on area1_mc) then two traces of ‘off map’, because it obviously isnt on area2_mc or area3_mc.
Please help.