Package | gs.util |
Class | public final class Inactivity |
Inheritance | Inactivity ![]() |
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.
var inact:Inactivity=new Inactivity(myMovieClip, 2000); inact.addEventListener(Inactivity.ACTIVE, whenActiveAgain); inact.addEventListener(Inactivity.INACTIVE, whenGoInactive); inact.start();
Property | Defined 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 |
Method | Defined 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 |
Event | Summary | Defined by | ||
---|---|---|---|---|
Dispatched when the user becomes active. | Inactivity | |||
Dispatched when the user becomes inactive. | Inactivity |
ACTIVE | property |
public static var ACTIVE:String = "active"
Defines the value of the type property of the event object used for active events.
INACTIVE | property |
public static var INACTIVE:String = "inactive"
Defines the value of the type property of the event object used for inactive events.
Inactivity | () | constructor |
public function Inactivity(scope:DisplayObject, inactiveTimeout:int)
Constructor for Inactivity instances.
Parametersscope:DisplayObject — The object to watch for user activity.
|
|
inactiveTimeout:int — The time in milliseconds to wait before the user is considered inactive.
|
start | () | method |
public function start():void
Start watching for inactivity.
stop | () | method |
public function stop():void
Stop watching for inactivity.
active | event |
inactive | event |