Re: Re: [Flashcoders] Best way to detect an idle user?

2006-11-28 Thread Richard Helgor

Chester,

Another dumb noob question from me, but I'm not great on Listeners...

How do I stop the class from checking for activity? I'm using it to
log-out back to a main menu swf on a certain duration, and I've tried:

myActivityMonitor.removeListener(myActivityMonitor);
Mouse.removeListener(myActivityMonitor);
delete myActivityMonitor;

and other things, all to no avail! I can't get it to stop, even when
the swf it is called in is replaced by the main menu swf. I'm using
Method 1.

Am I being really dumb?

TIA,
Warren.


On 11/9/06, Chester McLaughlin [EMAIL PROTECTED] wrote:

Here's a working class I whipped up. It uses onMouseMove to monitor
their activity.

// BEGIN CLASS
//  ActivityMonitor
//  Created by Chester McLaughlin on 2006-11-09.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Best way to detect an idle user?

2006-11-09 Thread Pete Miller

My application starts with a user login/authentication.  I want to
implement an idle user process that logs the user out after X amount of
time of no activity.

The most obvious way I can think to do this is to start an interval
timer, and keep reseting it any time a widget is used.  That means
adding a reset-function call to every component event handler, plus
adding event handlers for many components that otherwise don't have
relevant events.

Does anyone have a more clever way of handling this?
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Best way to detect an idle user?

2006-11-09 Thread Ben
Is it possible for you to decide wether a user is idle or not, by judging
his mouse movements? Or is it required to actually measure the usage of
particular elements? If you can suffice with the movement, it might be
enough to create a seperate 'idle checking' class which either listens to
mousemove events of for even less overhead, checks the mouse coordinates at
given intervals. Then say after e.g. 3 check intervals if the coords are
still the same, assume the user is inactive.
 
 

  _  

Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Pete Miller
Verzonden: donderdag 9 november 2006 22:45
Aan: Flashcoders mailing list
Onderwerp: [Flashcoders] Best way to detect an idle user?




My application starts with a user login/authentication.  I want to
implement an idle user process that logs the user out after X amount of
time of no activity.

The most obvious way I can think to do this is to start an interval
timer, and keep reseting it any time a widget is used.  That means
adding a reset-function call to every component event handler, plus
adding event handlers for many components that otherwise don't have
relevant events.

Does anyone have a more clever way of handling this?
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Best way to detect an idle user?

2006-11-09 Thread Chester McLaughlin
Here's a working class I whipped up. It uses onMouseMove to monitor  
their activity.


// BEGIN CLASS
//  ActivityMonitor
//  Created by Chester McLaughlin on 2006-11-09.

import mx.utils.Delegate;
import mx.events.EventDispatcher;

class ActivityMonitor {

var nLatestActivity:Number;
var nMaxIdleTime:Number;

var nIntervalID:Number;

var onMaxIdleTimeExceeded:Function;

private var broadcastMessage:Function;
public var addListener:Function;

function ActivityMonitor(nMaxIdleTime:Number)
{
AsBroadcaster.initialize(this);
Mouse.addListener(this);

this.onMouseMove();
this.nMaxIdleTime = nMaxIdleTime;

		this.nIntervalID = setInterval(Delegate.create 
(this,checkForActivity),5000);

}

function checkForActivity(){
var nNow = getTimer();
var nDiff = (nNow - this.nLatestActivity)/1000;

if (nDiff = this.nMaxIdleTime){
this.broadcastMessage(maxIdleTimeExceeded,nDiff);
this.onMaxIdleTimeExceeded(nDiff);
}
}

function onMouseMove()
{
this.nLatestActivity = getTimer();
}

};

// END CLASS

// BEGIN USAGE
/*
import ActivityMonitor;

// This creates an instance of Activity Monitor that requires the user
// to move their mouse at least once every 5 seconds
var myActivityMonitor:ActivityMonitor = new ActivityMonitor(5);

// Method #1
myActivityMonitor.onMaxIdleTimeExceeded = function(nDiff:Number){
//var nDiff:Number = arguments[0];
	trace(Method 1: You've been idle for +nDiff+ seconds. Get  
Moving!!!);	

}

// Method #2
myActivityMonitor.addListener(this);
function maxIdleTimeExceeded(nDiff:Number){
	trace(Method 2: You've been idle for +nDiff+ seconds. Get  
Moving!!!);	

}
*/

// END USAGE


On Nov 9, 2006, at 1:45 PM, Pete Miller wrote:



My application starts with a user login/authentication.  I want to
implement an idle user process that logs the user out after X  
amount of

time of no activity.

The most obvious way I can think to do this is to start an interval
timer, and keep reseting it any time a widget is used.  That means
adding a reset-function call to every component event handler, plus
adding event handlers for many components that otherwise don't have
relevant events.

Does anyone have a more clever way of handling this?
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed.  If 
you are not the named addressee you should not disseminate, distribute or copy 
this e-mail  Please notify the sender immediately by e-mail if you have 
received this e-mail by mistake and delete this e-mail from your system.  Any 
other use, retention, dissemination, forwarding, printing or copying of this 
e-mail is strictly prohibited.  Finally, the recipient should check this e-mail 
and any attachments for the presence of viruses.  Lambesis accepts no liability 
for any damage caused by any virus transmitted by this email.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Best way to detect an idle user?

2006-11-09 Thread Millie Niss
you might want a general purpose system where you could specify what is to 
be considered in determining idleness.  For example, do you check:


-- only clicking (on the grounds that someone could be moving the mouse 
around, for example to check tooltips or just aimlessly, but that they are 
idle of they aren't selecting/dragging etc.

-- mouse movements
--keystrokes (which ones?)
--data flow from/to server
--playing videos or sounds
--playing loaded swfs or subclips
etc.

seems to beg for some kind of observer or broadcaster pattern where you 
subscribe your idel detector to various events


Millie Niss
[EMAIL PROTECTED]
http://www.sporkworld.org
- Original Message - 
From: Ben [EMAIL PROTECTED]

To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com
Sent: Thursday, November 09, 2006 5:19 PM
Subject: RE: [Flashcoders] Best way to detect an idle user?



Is it possible for you to decide wether a user is idle or not, by judging
his mouse movements? Or is it required to actually measure the usage of
particular elements? If you can suffice with the movement, it might be
enough to create a seperate 'idle checking' class which either listens to
mousemove events of for even less overhead, checks the mouse coordinates 
at

given intervals. Then say after e.g. 3 check intervals if the coords are
still the same, assume the user is inactive.



 _

Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Pete Miller
Verzonden: donderdag 9 november 2006 22:45
Aan: Flashcoders mailing list
Onderwerp: [Flashcoders] Best way to detect an idle user?




My application starts with a user login/authentication.  I want to
implement an idle user process that logs the user out after X amount of
time of no activity.

The most obvious way I can think to do this is to start an interval
timer, and keep reseting it any time a widget is used.  That means
adding a reset-function call to every component event handler, plus
adding event handlers for many components that otherwise don't have
relevant events.

Does anyone have a more clever way of handling this?
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Best way to detect an idle user?

2006-11-09 Thread Pete Miller
Thanx, I'll give that a try!

P.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:flashcoders-
 [EMAIL PROTECTED] On Behalf Of Chester McLaughlin
 Sent: Thursday, November 09, 2006 5:39 PM
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] Best way to detect an idle user?
 
 Here's a working class I whipped up. It uses onMouseMove to monitor
 their activity.
 
 // BEGIN CLASS
 //  ActivityMonitor
 //  Created by Chester McLaughlin on 2006-11-09.
 
 import mx.utils.Delegate;
 import mx.events.EventDispatcher;
 
 class ActivityMonitor {
 
  var nLatestActivity:Number;
  var nMaxIdleTime:Number;
 
  var nIntervalID:Number;
 
  var onMaxIdleTimeExceeded:Function;
 
  private var broadcastMessage:Function;
  public var addListener:Function;
 
  function ActivityMonitor(nMaxIdleTime:Number)
  {
  AsBroadcaster.initialize(this);
  Mouse.addListener(this);
 
  this.onMouseMove();
  this.nMaxIdleTime = nMaxIdleTime;
 
  this.nIntervalID = setInterval(Delegate.create
 (this,checkForActivity),5000);
  }
 
  function checkForActivity(){
  var nNow = getTimer();
  var nDiff = (nNow - this.nLatestActivity)/1000;
 
  if (nDiff = this.nMaxIdleTime){
  this.broadcastMessage(maxIdleTimeExceeded,nDiff);
  this.onMaxIdleTimeExceeded(nDiff);
  }
  }
 
  function onMouseMove()
  {
  this.nLatestActivity = getTimer();
  }
 
 };
 
 // END CLASS
 
 // BEGIN USAGE
 /*
 import ActivityMonitor;
 
 // This creates an instance of Activity Monitor that requires the user
 // to move their mouse at least once every 5 seconds
 var myActivityMonitor:ActivityMonitor = new ActivityMonitor(5);
 
 // Method #1
 myActivityMonitor.onMaxIdleTimeExceeded = function(nDiff:Number){
  //var nDiff:Number = arguments[0];
  trace(Method 1: You've been idle for +nDiff+ seconds. Get
 Moving!!!);
 }
 
 // Method #2
 myActivityMonitor.addListener(this);
 function maxIdleTimeExceeded(nDiff:Number){
  trace(Method 2: You've been idle for +nDiff+ seconds. Get
 Moving!!!);
 }
 */
 
 // END USAGE
 
 
 On Nov 9, 2006, at 1:45 PM, Pete Miller wrote:
 
 
  My application starts with a user login/authentication.  I want to
  implement an idle user process that logs the user out after X
  amount of
  time of no activity.
 
  The most obvious way I can think to do this is to start an interval
  timer, and keep reseting it any time a widget is used.  That means
  adding a reset-function call to every component event handler, plus
  adding event handlers for many components that otherwise don't have
  relevant events.
 
  Does anyone have a more clever way of handling this?
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they are
 addressed.  If you are not the named addressee you should not
 disseminate, distribute or copy this e-mail  Please notify the sender
 immediately by e-mail if you have received this e-mail by mistake and
 delete this e-mail from your system.  Any other use, retention,
 dissemination, forwarding, printing or copying of this e-mail is strictly
 prohibited.  Finally, the recipient should check this e-mail and any
 attachments for the presence of viruses.  Lambesis accepts no liability
 for any damage caused by any virus transmitted by this email.
 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com