Need help with vaules or something to count! >< (It's holding me back! Part2)

Hiya again I’m stuck =-_-=. Well when I program games i used a of objects i like to call “counters” I thinking that varibles is what im suppose to use. Well its like i would use these to tell to perform a certain action like for example if

if red = 0 then end game
if red = 1 then run game

the problem i have here is that on my game Im trying to make my character punch but the problem is the action that stops him from running after letting go. but now thats stopping him from when i press anything I look at tutorial everywhere but you know none of them not even one teaches you how to change animations while moving a charcater.

Here the code as you probaly seen it already:

onClipEvent(load){
moveSpeed=10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x+=moveSpeed;this.gotoAndStop(2);
} else if (Key.isDown(Key.LEFT)) {
this._x-=moveSpeed;this.gotoAndStop(2);
}else {
this.gotoAndStop(1);
}
}

now you can see that if none of these keys are press on the keyboard then he stops but that also means if im press the z key to punch he going to still stop since i didnt press the left or right ;_;.

So I want to put a counter or something called “stoprun” that can tell him to stop when this is at a certain number so I can put the counter on another number.

So i really dont know how to set up anything with vaules like score, lives, and energy bars and etc. cause I dotn know how to do vaules and stuff cause i dont know script! >< this is the only thing i need left and i shouldnt have anymore problems making a game in flash.