im working on a fps game. The game contains multiple enemy. But im calling the same movieclip as enemy. That movieclip dispatches fire event and reduce player life. But i need to know which movieclip is dispatching event. I've added enemy randomly, i need to know the enemy location of the enemy who just have fired. Heres some code which may help...
dispatchEvent(new Event('Enemy_Fired')); // this event is dispatching from enemy movieclip
this.addEventListener('Enemy_Fired',ReduceLife);
public function ReduceLife(e:Event){
life--;
var currentLife:int = life * lifeRatio;
if(life<1){
Game_Over();
//game_completed();
} else {
sview.playerhit.gotoAndPlay(2);
sview.lifebar.gotoAndStop(100 - currentLife);
sview.health.text = String(currentLife);
}
//Here i need to know this event dispatched from which enemy
}
Thanks in advance