After detecting that the user is idle for more than the wait time, the ‘areyoustillthere.swf’ movie is played. Which works fine.
But as this movie is played, i want to confirm if the user is really not there. So i need to detect his mousePos again. How do i do that?
var numWaitTime:Number = 2*1000; // Time in seconds to wait, before switching back to main screen
startTracking();
function startTracking() {
mousePos = -100000;
trackMove = setInterval(detectIdle, 2000);
}
function detectIdle() {
if ((_root._xmouse+_root._ymouse) != mousePos) {
clearInterval(idle);
idle = setInterval(idleTime, numWaitTime);
}
mousePos = _root._xmouse+_root._ymouse;
}
function idleTime() {
_root.createEmptyMovieClip("mc1", this.getNextHighestDepth());
mc1.loadMovie("data/areyoustillthere.swf");
trace("are you still there?");
mc1._x = 250;
mc1._y = 125;
new Tween(mcAsk, "_alpha", Regular.easeIn, 25, 100, 1, true);
mousePos = _root._xmouse+_root._ymouse;
}
function startTracking() {
trace("bring user back to home");
}