Keypress

hi everyone!
im trying to make a fighting game and i need to know how to do basic keypressing thingos.

i’ve got my character with all its animations and whatnot (as a movieclip)
now i need to know how to make it attack/die whatever when a certain key is pressed.

so, yeah i need codes.

your help would greatly be appreciated.
(can you please state wether the codes go on the movieclip or a layer, or whatever. thanks.)