private function onEnemigo(e:TimerEvent):void{
var tiempoTranscurrido:int = getTimer() - ultimoEnemigo;
if(tiempoTranscurrido > proximoEnemigo){
ultimoEnemigo = getTimer();
var enemigo: int = Math.floor(Math.random() * numeroDeEnemigos);
this["enemigo"+enemigo+"_act"].play();
proximoEnemigo = Math.floor(Math.random() * 2000);
}
}
I want to play a random Scene between enemigo0_act and enemigo4_act, considering that numeroDeEnemigos = 4.
Why does "this["enemigo"+enemigo+"_act"]" work? It works how it should but I don't understand why, I mean, what exactly is the function of "this" in this example?