Need some help

I’m making an RPG with the following stracture:

on the main stage is a hud MC, inside it are status screens and the fight screen.
In the fight screen we have a figure of the hero character and 3 spots for enemies (it is calculated on the mainstage how many enemies will be in the fight and which enemies), the enemy MCs have inside them frames with different lables and different enemies accordingly.
To attack, the player first chooses an attack from another part of the hud, and then he has to click on which enemy he wants to attack, inside the attack animation of the hero character are actions like:


_root.trgt is defined when clicking on the button of one of the enemies (to choose which one to attack).

When an enemy dies, he substracts 1 from a variable that tells how many enemies are in the fight, and when it reaches 0, the battle is over.

Now here is the problem:

How will I make it so after I’ve killed one enemy, I can’t “kill” him again, and thus substracting another 1 from the variable of how many enemies on stage without attacking the other enemies?

I tried putting this in the end of the enemy’s death animation:

_root._parent._name = true;

And then on the enemy selection button I do something like this:

if(_root.enemy1!= true){
//do attack on enemy1

And so on with enemy2, 3… (every enemy has his own button)

But it didn’t help (_root._parent._name didn’t define a variable).

I hope I explained my self clearly enough, it’s very difficult to explain the situation without the actual source file (too big). I hope someone will be able to help me…

im not too hot on this stuff… but i dont think you can do


i think it has to be one or the other… im not sure though…

I appreciate your help, Scootmant, but I prefer someone more experienced will answer me. Showing me the answers instead of questions will be much more helpful.


I also tried


but it returned a syntax error.