hi,

The code works in the browser as long as the swf has focus, i.e., you have to click on it.

On a side note... I prefer the following conditional:
actionscript Code:
if (Key.getCode() == Key.ESCAPE) {