Hello,
again i’m struggling with the walk animation of my character, he can move right with animation, but if he walks left , the animation just freezes at the first frame? here’s the code:
onClipEvent(enterFrame){
if(Key.isDown(Key.RIGHT))
this.gotoAndStop(“walk”)
else
this.gotoAndStop(“idle”)
}
onClipEvent(enterFrame){
if(Key.isDown(Key.RIGHT))
this._x +=10;
}
onClipEvent(enterFrame){
if(Key.isDown(Key.LEFT))
this.gotoAndStop(“walkl”)
}
onClipEvent(enterFrame){
if(Key.isDown(Key.LEFT))
this._x -=10;
}
Does anyone know a better code or knows how to fix this one?
I am fairly new to actionscrip and i wrote the code myself.
thanks in advance