Packagegs.util
Classpublic final class Inactivity
InheritanceInactivity Inheritance flash.events.EventDispatcher

The Inactivity class can be used to watch for inactivity within the scope of a DisplayObject.

Continuous events are not dispatched, they only dispatch when the state changes. So if the user goes from active to inactive, the inactive event will be dispatched. As soon as they go active again, the active event is dispatched.


Example
Using the inactivity class:
 
  var inact:Inactivity=new Inactivity(myMovieClip, 2000);
  inact.addEventListener(Inactivity.ACTIVE, whenActiveAgain);
  inact.addEventListener(Inactivity.INACTIVE, whenGoInactive); 
  inact.start();
  



Public Properties
 PropertyDefined by
  ACTIVE : String = "active"
[static] Defines the value of the type property of the event object used for active events.
Inactivity
  INACTIVE : String = "inactive"
[static] Defines the value of the type property of the event object used for inactive events.
Inactivity
Public Methods
 MethodDefined by
  
Inactivity(scope:DisplayObject, inactiveTimeout:int)
Constructor for Inactivity instances.
Inactivity
  
start():void
Start watching for inactivity.
Inactivity
  
stop():void
Stop watching for inactivity.
Inactivity
Events
 EventSummaryDefined by
   Dispatched when the user becomes active.Inactivity
   Dispatched when the user becomes inactive.Inactivity
Property detail
ACTIVEproperty
public static var ACTIVE:String = "active"

Defines the value of the type property of the event object used for active events.

INACTIVEproperty 
public static var INACTIVE:String = "inactive"

Defines the value of the type property of the event object used for inactive events.

Constructor detail
Inactivity()constructor
public function Inactivity(scope:DisplayObject, inactiveTimeout:int)

Constructor for Inactivity instances.

Parameters
scope:DisplayObject — The object to watch for user activity.
 
inactiveTimeout:int — The time in milliseconds to wait before the user is considered inactive.
Method detail
start()method
public function start():void

Start watching for inactivity.

stop()method 
public function stop():void

Stop watching for inactivity.

Event detail
activeevent 
Event object type: flash.events.Event

Dispatched when the user becomes active.

inactiveevent  
Event object type: flash.events.Event

Dispatched when the user becomes inactive.