=================================
=================================
=================================
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.
=================================
=================================
=================================
'ADOBE > ActionScript' 카테고리의 다른 글
aodbe air 액션스크립트 as3 zip unzip 해보기 관련 (0) | 2016.07.06 |
---|---|
Adobe AIR 액션스크립트 as3 윈도우창 위로 올리기 front 관련 (0) | 2016.07.04 |
adobe air 액션스크립트 투명 윈도우창(Chromeless Window) 설정하기, 윈도창 투명 적용 하기 (0) | 2016.06.30 |
[AS] 플래시 as3 이미지,부드로운 스무드 이미지로드, 파일 로드 관련 (0) | 2016.06.27 |
[air for android , IOS ]app에서 air로 만든 app호출 하면서 파라미터 보내기 (0) | 2016.06.22 |