Key Listeners

Hi

I’m trying to use Key Listeners to solve my problem.
I don’t know much about key liseners so can somebody help me out.

I have the following on a keyframe yet it still wont jump to the certain frames when I press the relevent keys. Am I missing something?

stop();
KeyListener = new Object();
KeyListener.onKeyDown = function() {
if (Key.getAscii() == 38) { // UP key
gotoAndStop(89);}
if (Key.getAscii() == 40) { // DOWN key
gotoAndStop(91);}
if (Key.getAscii() == 37) // LEFT key
gotoAndStop(88);}
if (Key.getAscii() == 32) { // SPACEBAR key
loadMovie(“application_01.swf”, “container”);}