Inactivity detection

I would like to detect whether the mouse has been inactive for about a minute and if so i would like to load another swf. (Back to the main menu)
Obviously, when the mouse is moved, it would have to reset the timer.

I know in theory how i might do this with mousemove or getTimer but i am not skilled enough to write the script. Still learning.

Any ideas?

[AS]var mouseListener = new Object(), mySeconds = 60;
function startTimer() {
initial = getTimer()/1000;
}
function doyourstuff() {
_root.onEnterFrame = null;
trace(“OK”); //do your stuff here
}
_root.onEnterFrame = function() {
elapsedTime = Math.floor(getTimer()/1000-initial);
(elapsedTime == mySeconds) ? doyourstuff() : trace(elapsedTime);
};
mouseListener.onMouseMove = startTimer;
Mouse.addListener(mouseListener);
startTimer();[/AS]

hi i am TY :slight_smile:

Welcome :wink:

claudio,
Thanks a lot, it works great! I couldn’t have ever come up with that.

welcome Rob
:wink: