|
|||
|
1. I want to set "form.onExit" function. How can i get a pointer to my main form?
2. Is it possible to prevent application from closing (catch exit message) ?
__________________
#define true false //happy debugging, friends |
|
|||
|
1. To close the main window
Code:
var wnd = getMainWnd(); wnd.close(); Code:
var wnd = getMainWnd();
wnd.onQueryClose = function () {
// return true to close the main window, false to cancel closing
return true;
}
|
|
|||
|
Thanks, i've got it!
But, could u say, how to set "wnd.onQueryClose = function" where "function" is a pointer to my AS2 function?
__________________
#define true false //happy debugging, friends |
|
|||
|
In as2, you can use the following code to handle the onQueryClose event
Code:
import SWFKit.*;
function onQueryClose() {
...
}
var wnd = Global.getMainWnd();
wnd.setEventHandler("onQueryClose", onQueryClose);
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|