Client/User Idle Timeout Component
April 16, 2007 by udayms
I was looking around in the net for an effective client/user IDLE TIMEOUT mechanism. My requirement was very simple - The UI should time-out if the user is idle for more than 5 minutes. In geek terminology, IDLE translates to zero keystrokes and zero mouse movements.
After googling around and then spending some time at Flexcoders, I came across a link from the CFML site - an example for just what I wanted to do
. So, we went and took that script and added a few bells and whistles to it before converting it into a re-usable component. And here’s what we have :-
The ClientIdleTimeOut component can be added to an application using-
<flexed:ClientIdleTimeOut id="TimerId" onTimeOut="FunctionPassedFromCaller" listenKeyStroke="true|false" listenMouseMove="true|false" timeOutInterval="1" confirmInterval="1" />
Now, when the application starts, the timer starts. If there is no user activity for the timeOutInterval specified, then a timeout warning pops up and stays up for confirmInterval time. Once the confirmInterval has been crossed, the application is timedout. At this point, three actions happen - 1. The application is disabled; 2. The FunctionPassedFromCaller set to the onTimeOut attribute is fired; 3. An event of type appTimedOut is dispatched. We can have a listener for this event and fire our actions at this point apart from the onTimeOut function.
So, thats what the ClientIdleTimeOut does
. Check it out. Enjoy
PS: The Demo has an idle timeout for 3 mins. and a warning prompt of 2 mins. The ASDocs provided is more of an experiment
.



Great thanks this will come in handy
good work dude!
what I’m trying to do is build a standalone swf file (not run from a html page) which gets the User/System Idle Time and use this variable in my AS3 code. There are some examples for how to retrieve this in Java & C:
Windows - http://ochafik.free.fr/blog/?p=98
OSX - http://macenterprise.org/content/view/121/140/
Can I call Java or C code from AS3 and retrieve a value?
Any help would be appreciated.
Great work!
Regards,
Sugan (South Africa)
Nice work.