简体   繁体   中英

adobe air and window.close()

I have a simple task to do but I really don't know how to do this. I created a Fullscreen Adobe Air application which does window.location='http://example.com' to load an external page just in a tag.

The problem is that I can't close the Air application from that page using window.close(); - it just doesn't work. If I load http://example.com into and put a window.close() button after tag it works no problem at all. Anyway I can't use as example.com use frames and it stops working properly when loaded to . Could you please help me with that. I hope you understand what I wrote.

尝试使用window.nativeWindow.close();

If your using JQuery you can do something like this:

 function closeWindow() {
     window.nativeWindow.close();
 }


 $("#buttonClose").click(function() {
     closeWindow();
 });

The following functions demonstrate the NativeWindow maximize(), minimize(), restore(), and close() methods, just attach them to HTML elements the same way as above:

 function windowMaximize(){ 
     window.nativeWindow.maximize(); 
 } 

 function windowMinimize(){ 
     window.nativeWindow.minimize(); 
 } 

 function windowRestore(){ 
     window.nativeWindow.restore(); 
 } 

 function windowClose(){ 
     window.nativeWindow.close(); 
 }

Hope that helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM