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
  •  | 
  •  

Domanda

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?

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top