Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-16-2007, 05:23 PM
Member
 
Join Date: May 2007
Posts: 53
Default How to get a main form handler

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
Reply With Quote
  #2 (permalink)  
Old 05-17-2007, 01:50 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:How to get a main form handler

1. To close the main window
Code:
var wnd = getMainWnd();
wnd.close();
2. Sure, by handling the onQueryClose event
Code:
var wnd = getMainWnd();
wnd.onQueryClose = function () {
    // return true to close the main window, false to cancel closing
    return true;     
}
Reply With Quote
  #3 (permalink)  
Old 05-17-2007, 07:54 AM
Member
 
Join Date: May 2007
Posts: 53
Default Re:How to get a main form handler

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
Reply With Quote
  #4 (permalink)  
Old 05-17-2007, 10:06 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:How to get a main form handler

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);
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:17 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.