# Users Currently Online (AS3/XML/PHP)

**URL:** <https://forum.kirupa.com/t/users-currently-online-as3-xml-php/307839>\
**Category:** flash\
**Created:** [April 11, 2010, 7:02pm UTC](https://forum.kirupa.com/t/users-currently-online-as3-xml-php/307839 "2010-04-11T19:02:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![noahssite](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@noahssite](https://forum.kirupa.com/u/noahssite)\
**Post date:** [April 11, 2010, 7:02pm UTC](https://forum.kirupa.com/t/users-currently-online-as3-xml-php/307839/1 "2010-04-11T19:02:41Z")

</div>

Hello,

I recently made a chat room using Flash/AS3 as the interface and client, XML as the database and PHP to edit the XML file. While searching for similar chat clients over the internet I noticed that most of them had a list of the users currently online. They even notified you when a user logged off or exited their browser / chat client in anyway.

To make a list of the users currently online I would think to add their names to an XML file. Easy enough. So when users enter the chat room they get added to the list of users online.

What if a user goes offline? I would want to pass arguments to my PHP file to remove them from the XML file.

**In AS3, how do I handle the event of a user going offline?** (ie. exiting their browser, exiting flash, **losing their internet connection** , etc…)

I know I am able to add an event listener to a Javascript window.unload() but what if the user just loses their internet connection? My program won’t be able to send arguments to my PHP file.

\*\*What is an alternative way to monitor which users are currently online? \*\*

Thanks in advance,  
Noah
