Return Key presses (AS2)

I have code on my flash that allows the user to tab to certain buttons and press enter to enter it… but when ever I hit return with the keypress code it wipes the .swf file and goes blank… is this something to do with refreshing? Can anyone point out where I am going wrong… thanks :slight_smile:

 
var EscapeListener:Object = new Object();
EscapeListener.onKeyDown = function() {
 
 if (Key.getCode() == 27) {
  
  _root.exitP_mc._visible = false;
  _root.alpha_mc._visible = false;
  
 } else if (Key.getCode() == 13) {
 
root.exitP_mc._visible = false;
  _root.alpha_mc._visible = false;
 
 }
};
Key.addListener(EscapeListener);