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