That works perfectly. They can't hit refresh/back/close without triggering that pop-up window. Exactly what I needed.
Thanks, L. --- In [email protected], Peeyush Tuli <peeyus...@...> wrote: > > window.onbeforeunload = function() { > return "It is not recommended to use the browser > close/refresh/close buttons unless you have saved your data and logged out"; > } > > Add the above code to a javascript section on the html wrapper which loads > your application. This will raise a javascript alert on all browser actions > which cause a redirect away from the current page. I dont think there is a > foolproof way to listen to this event directly in your swf. > > ~Peeyush > http://www.mds.asia > > > On Sun, Feb 21, 2010 at 12:40 PM, Laurence <lmacne...@...> wrote: > > > > > > > In my app, if you click the browser's refresh button, it re-loads the app > > and starts it over from the beginning (as you'd expect.) > > > > I want my app to be able to capture this refresh event (or perhaps just > > block it completely?) so that users won't lose all the data they've entered > > if they accidentally click the browser's refresh button. Ideally it would > > give them a pop-up window telling them that they're about to lose all their > > data, and allow them to cancel the refresh if they desire. > > > > Is this possible? How can I do that from my Flex app? > > > > Thanks, > > Laurence MacNeill > > Mableton, Georgia, USA > > > > > > >

