air监听关闭按钮事件
看个人的需要。有的项目是用到系统的镶边,有的不需要。关于Flash builder 发布air设置无镶边是这样的。请找到项目xml文件中的systemChrome节点,将其打开,设置值为none就可以了。想要背景透明,找到项目xml文件中的transparent节点,将其打开设置成true就可以了。默认这两个节点都是关闭的。 stage.nativeWindow.addEventListener(Event.CLOSING,closingHandler); private function doClosing():void { var closingEvent:Event = new Event(Event.CLOSING,true,255)">true); stage.nativeWindow.dispatchEvent(closingEvent); if(!closingEvent.isDefaultPrevented()) { NativeApplication.nativeApplication.exit(); } } function closingHandler(e:Event):void { //这里有要处理的事情。 event.preventDefault(); //阻止默认的事件?
stage.nativeWindow.close();//手动关闭程序
}
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |