Problems with numbers in current frame statement

Hey friends, I’m making a stick fighting game and have fun into a few problems, maybe lostinbeta or some other super genius could help me out, :bad:.

I’m creating the sticks actions right now and have been experimenting with a script so when you punch you don’t move. Look:


onClipEvent (enterFrame) {
	if (Key.isDown(key.LEFT)) {
		_x -= 5;
	}
}
onClipEvent (enterFrame) {
if (this._currentframe==9 - 16) {
         if (Key.isDown(key.RIGHT)) {
		_x += 0;
		 }
} else {
	if (Key.isDown(key.right)) {
		_x += 5;
	}
}
}

See where it says “onClipEvent (enterFrame) {
if (this._currentframe==9 - 16) {
if (Key.isDown(key.RIGHT)) {
_x += 0;
}”? I want it to be when it’s between 9 and 16 that you can’t move, ie: _x + 0. But 9 - 16 doesn’t work, I think it takes it as 9 subtracted by 16. Any suggestions?

Thanks in advance,
KoRRupt

if (this._currentframe == 9 || this._currentframe == 16) {

?? … :slight_smile:

or

if (this._currentframe > 9 && this._currentframe < 16) {

?? … :slight_smile:

between 9 and 16

oops … stupid me :trout:

:stuck_out_tongue:

LOL, Thanks fellow friends…

It worked… :bad:

Thanks again,
KoRRupt