Battle Sequence Problem

Hello all, i have a very strange problem which i cannto seem to understand.
My battle code seems to have a mind of its own (and is very stubborn) it sometimes and sometimes doesnt, soemtimes it lets you attack the monster 3 times other times 1 time.

And the same back it sometimes lets the monster hit u and sometimes doesnt, when it doesnt let u do something it just pauses and holds at that position.

here all try it out for yourself XD lol i hope someone can help me with this problem as ti is very annoying.

http://82.110.105.20/kreate-designs.com/game2.swf

here is links to the .fla and .as

http://82.110.105.20/kreate-designs.com/game2.fla
http://82.110.105.20/kreate-designs.com/functions.as