상세 컨텐츠

본문 제목

AIR 액션스크립트3 AS3 앱 윈도우 창 기본창 닫음 닫기 버튼 이벤트

ADOBE/ ActionScript

by AlrepondTech 2016. 6. 30. 02:38

본문

반응형
728x170

 

 

 

 

=================================

=================================

=================================

 

 

 

 

 

My question is how can I prevent the user from closing the application?. I need an alert message to appear that asks the user if he really want to leave the application. My application is developed inAdobe AIR. Please help, I am in trouble.

 

 

---------------------------------------------------------------------------

 

 

Yeah, I had a doozy finding this too. But it really is quite simple to intercept and prevent the close.

Beware that this code will prevent standard window closing only! I don't recommend using it without adding the confirmation dialogue or close code in place of the comment.

stage.nativeWindow.addEventListener(Event.CLOSING, onCloseCall);  function onCloseCall(evt:Event):void {     evt.preventDefault();     //Show dialogue here. } 

Now, how to show the alert message (a.k.a. dialogue box) depends entirely on your platform, method, and needs. For example, if you use Flash Professional, a custom movieclip that you hide and show might do the trick. However, if you use Flex, there are means of creating a modal dialogue. Research that separately.

 

 

=================================

=================================

=================================

 

 

반응형
그리드형


관련글 더보기

댓글 영역