# Walk animation

**URL:** https://forum.kirupa.com/t/walk-animation/231499
**Category:** Uncategorized
**Created:** [July 5, 2007, 11:29am UTC](https://forum.kirupa.com/t/walk-animation/231499 "2007-07-05T11:29:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Mr\_Pancake](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mr\_Pancake](https://forum.kirupa.com/u/Mr_Pancake)
#### Post date: [July 5, 2007, 11:29am UTC](https://forum.kirupa.com/t/walk-animation/231499/1 "2007-07-05T11:29:47Z")

</div>

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
