Another way to do it, for fighting game example...
If I my character is attacking, I set his IsAttacking instance variable to 1. So for any button that I don't want to interrupt his attack's (like running, or another attack) , I do this...
and SideAttack is pressed = > set IsAttacking to 1, play animation side attack,
so If i press the run button, it won't work while he's attacking.
AND run is pressed. => Run
Then I clean it up by...
on Any Animation Finished = > Set IsAttacking to 0
This way, animations can't interrupt him while he's attacking.
Just another way to do things :)