If its about animating, google "Flash Walk Cycle Tutorial". You would be able to see a plethora of tuts that can help you.
For the Code, just add an event listener for whatever button you want the player to use i.e. "D" then have a gotoAndPlay(1); on your mc. Make sure it loops and that it flips when the player walks into another direction.
You are new in this aren't you? If you are, then read this: It will help you