Movement Controls?

im making a game and i want to know how do you make a symbol that moves by using the ARROW keys and also how to make a wall so they don’t go through.

http://www.kirupa.com/developer/mx/movement_keys.htm

http://www.kirupa.com/developer/actionscript/hittest.htm