How to notice the situation when flash applet is being closed e.g. browser back button

StackOverflow https://stackoverflow.com/questions/22148485

  •  19-10-2022
  •  | 
  •  

문제

How to catch up a situation when FLASH is forced to close e.g. because of BACK button click, I need to make one HTTP call before that.

my code:

 stage.addEventListener(Event.CLOSE,unloadEvents,false,0,true);

I can see that FocusEvent.FOCUS_OUT event occurs in that case, but CLOSE or UNLOAD focuses are not appearing?

도움이 되었습니까?

해결책

You need javascript to protect from leaving the current page where your flash is located. If user really wants to leave the page then make your http call, else just stay inside the page.

Here are some links... that should help:

How to logout during onbeforeunload/onunload using Javascript

To execute Flex cleanup function when browser is closed by user

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top