Help with movement animation

Please help me make it so when my character moves is plays the whole movement animation and not just one frame. Heres the code:

onClipEvent (load) {
moveSpeed = 4;
}
onClipEvent (enterFrame) {
if (Key.isDown (Key.RIGHT)) {
this._x += moveSpeed; _xscale = -100;
this.gotoAndPlay(1);
}
if (Key.isDown (Key.LEFT)) {
this._x -= moveSpeed; _xscale = 100;
this.gotoAndPlay(1)
}
 

the movemnt animation is 10 frames long but it only plays the first frame in the movie clip and then stops.

I want it to be something like this http://baiwanfuong.notix.net/tienzsiyusi.htm

Please help me Chen!