Timer / "screensaver" function across multible frames
Hi Flash KIT useres.
I am working on a instore touchscreen solution for customers. It build across multible frames with basic navigation videos ect.
I would like to add a timer + event on each frame tracking if the application is idling for lets say 5 min on one frame then I want to send it back to the "start menu" frame 1.
The code I have is this;
Quote:
import flash.utils.Timer;
import flash.events.*;
var inactiveTime1:int = 300000;
var t1:Timer = new Timer(inactiveTime1);
stage.addEventListener(MouseEvent.MOUSE_DOWN, timerReset1);
t1.addEventListener(TimerEvent.TIMER, onTimer1);
t1.start();
function timerReset1(e:MouseEvent):void {
t1.reset();
t1.start();
}
function onTimer1(e:TimerEvent):void {
handleInactivity1();
}
function handleInactivity1():void {
gotoAndPlay(1);
t1.removeEventListener(TimerEvent.TIMER, onTimer1);
}
The functions timers are named continiously throughout the frames ect. t1,t2,t2 ...
The problem is when I navigate quickly through the frames with the other navigation buttons it seams like the timerfunctions or timer is
not removed from the frames and releases even though the user is still active..
I tested it in smaler scale with 3 frames and it seams to have the same issue.
I dont know if I remove the timer properly or what the solutions it to this.
Can somebody help me solve this issue?