I'm feeling helpful today, so here you go. I'm going to assume you know how to make the player move and simply want to know how to make it play the relevant animation to each direction.
Inside of the player movieclip, have one frame for each direction. On each frame, have another movieclip of the animation for that direction. The label the direction frames 'up', 'left', whatever directions you have (no quotes around them, though). Then on the player movieclip, add this line of script to the block for each direction:
_root.player.gotoAndStop("direction");
Make sure to change direction for each block to the actual frame label you set, with quotes around it.
Now, you want to stop the walking animation when you stop moving, right? So after all the blocks of code for the different directions, add something along the lines of this:
if (!Key.isDown(Key.UP) && !Key.isDown(Key.DOWN) && !Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)) {
_root.player.gotoAndStop("stop frame");
}
Remember to change stop frame to the label of the frame within your player movieclip where the player is standing still (or whatever animation you want it to play when you aren't moving).
I hope I helped XD