I also have the same question. Have you known how to do it yet?
Have you known how to do it yet?
Sorry. I don't know. I'm finding solution for this.
Not sure if this is actually possible. I have got the same issue while closing my Flash based extension, using swatch closed button (top right cross).
There is no way to handle the close event, unfortunately....
Put a trace() to print the keyCode into the stage's keydown handler and run your extension in debug mode of flash builder, you can check whether ESC is pressed or not.
However, I don't know how to prevent extension from closing neither.