Animating character set

I got this character set:

The question is, how to implement walking:

  • down (characters in yellow border)
  • left (characters in red border)
  • right (characters in green border)
  • up (characters in brown border)

and when player is not walking, then is set first character of direction in which this character is.

Oh! I’d forget:
How do you make modal windows, for example for shops, NPCs talking ? Just to not do anything except clicking in window area.