Thanks much, thatis a great idea. I will look into this and
hopefully it should work.
Thanks,
Barry
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Abdul Qabiz
Sent: 27 June 2005 15:39
To: [email protected]
Subject: RE: [flexcoders] Catching the Closing of the Browser in Flex
Hi,
Another way is to catch the unload events of browser in
_javascript_. I am not sure, if it works consistently in all browsers but IE
and Firefox 0.9 version support it. So make sure of such things
before using...
Search for onBeforeUnload and onUnload events for browser.
The logic could be:
- User tries to close the browser
- you capture the event in onBeforeUnload, show a _javascript_ alert to user that "s/he should
save data before existing, click Ok to save or Cancel to
close"..
- If user clicks Ok, s/he on same, send a notification to
Flex app using (_javascript_ or _javascript_FlashKit).
- Flex app saves data to DB and closes the browser when
done...
Does that sound good?
you will need to test this approach
properly.
Link for a demo
of onBeforeUnload(..)
You can use the technique mentioned
there....
Link for
_javascript_-Flash-Integration-Kit: http://www.macromedia.com/go/flashjavascript/
Related post on
Mike Chembers blog: http://weblogs.macromedia.com/mesh/archives/2005/06/flash_javascrip.cfm
-abdul
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Dirk Eismann
Sent: Monday, June 27, 2005 7:52 PM
To: [email protected]
Subject: RE: [flexcoders] Catching the Closing of the Browser in Flex
You could use
the application server's session management - the user session will
time out by default after a given amount of inactivity so you could probably
hook in there.
If you need some kind of real-time logging
then you might want to take a look at the Flash Comm Server - this way you
could establish a persistent connection between client and server. If the
browser is closed the connection to the Flash Comm Server will be closed and the
Flash Comm Server in turns could send a Remoting request to your backend and
inform it to write to the db.
One implication is that the Flash Comm
Server uses the RTMP protocol which may not get through a restricted firewall.
It's also possible to tunnel RTMP through HTTP but again, a packet filter could
suppress this traffic.
Dirk.
Von: [email protected] im
Auftrag von Barry Corrigan
Gesendet: Mo 27.06.2005 16:02
An: [email protected]
Betreff: [flexcoders] Catching the Closing of the Browser in Flex
Gesendet: Mo 27.06.2005 16:02
An: [email protected]
Betreff: [flexcoders] Catching the Closing of the Browser in Flex
Hello
all,
I wish to write to a
database whenever a user logs out. When the browser is closed, this is an
implicit logout: the user can click the close icon on the title bar, go to
File-Exit in the browser's menu, press Alt-F4, browse to another page, etc. It
would be nice to be able to catch when this happens, so as to write the log and
logout the user.
I have tried
using the unload event in the Application tag, but this does not seem to
work.
Does anybody have
any other ideas? Is there soemthing obvious I am missing?
Thanks a
lot,
Barry.
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

