Ok so basically I got mobs spawning at intervals, using attachMovie(), name them mob1,mob2,mob3,etc. They run upward onEnterFrame towards some police dudes also spawned using attachMovie(), named police1,police2,etc.
Now when the mob hits the police, the mob should be removed from the stage.
On the mob_mc first frame I got
var count:Number = 1;
onEnterFrame = function(){
//moves mob upwards
_y -= Math.random()*10;
//if mob is offscreen, removemoveclip
if(_y <= -25){
removeMovieClip(this);
}
//if mob hits police, removemovieclip
for(count = 1; count <= 10; count++){
if(this.hitTest(_root["police"+count])){
removeMovieClip(this);
}
}
}
It works fine, until I happen to let one of the mobs by, then everything turns to crap. Sometimes more than one mob disappears, sometimes mobs go straight through the police(no hit detection). Yeh, I can’t figure this one out.