PDA

View Full Version : Ask user before closeing application


Gmc_fx
05-08-2009, 09:59 AM
Hello,

How to detect when user press "X" in main window in order to close application. I would like to ask user to confirm that he/she wants to close it. I done it when user click on button "Close" inside my application but can't make it work for "X" on top of main window.

Tnx

evride
05-08-2009, 03:27 PM
try

stage.nativeWindow.addEventListener(Event.CLOSING, appClosing);
function appClosing(){
//check for confirmation
}

Gmc_fx
05-08-2009, 10:10 PM
hmm, i get error:
Cannot access a property or method of a null object reference.

when using your code