Hmmm, Looks like you are very new to Flash..
Observing your code I can easily say that you are trying to code without any hardwork.. I mean you just copied this code from somewhere... Am I right ?? OK
According to the you wrote.. You are trying to move the Character left right with animations.
The code seems correct but..
But.. for the movement you must've a Movieclip with instance bg behind character to make it move..
And for the movement you are decreasing and increasing bg's _x by the variable 'speed' for which you have'nt given a value..
Use this code.. instead of the old one and tell me..
onClipEvent(load){
speed = the Number (eg:8)
}
so the whole code will be
onClipEvent(load){
speed = 8
}
onClipEvent (enterFrame) {
if(key.isDown(key.RIGHT)){
_root.bg._x -= speed;
this.gotoAndStop(2);
}
else if(key.isDown(key.LEFT)){
_root.bg._x += speed;
this.gotoAndStop(3);
}
else
this.gotoAndStop(1);
}
Tell me if it'll work then I will tell you about attacking etc.