I have instances like enemy1, enemy2 and enemy3 and more… Each one of them have a “public takedamage()” function. I have named them with “name” property.
How can i reach them in a loop?
for (var i:Number = 0; i < enemycount; i++)
{
world.getInstance("enemy"+i.toString()).takedamage();
}
Debugger result:
[Fault] exception, information=TypeError: Error #1010: A term is undefined and has no properties.
And debugger is not showing me which part of code is wrong…
What i need to do to make what i want?