Hello:
I have one principal menu with six buttons, each button open (in a loader) new menues flash movies, one of them flash movie, for example, has 20 buttons each button open in a loader a new movie. I need to detect inactivity for ten minutes for example and come back to the principal menu. Do I have tu put the code in all movies or there is a way tu put only in the movie with 20 buttons?
thank you very much
your main swf can detect events in all loaded swfs. so, if you wanted to detect 10min mouse inactivity, in your main swf:
var t:Timer=new Timer(10000,0);
t.addEventListener(TimerEvent.TIMER,timeoutF);
t.start();
this.addEventListener(MouseEvent.MOUSE_MOVE,moveF);
function moveF(e:MouseEvent):void{
t.reset();
t.start()
}
function timeoutF(e:TimerEvent):void{
// do whatever because of mouse inactivity
}
if you no longer need the timer after one timeout, use:
var t:Timer=new Timer(10000,0);
t.addEventListener(TimerEvent.TIMER,timeoutF);
t.start();
this.addEventListener(MouseEvent.MOUSE_MOVE,moveF);
function moveF(e:MouseEvent):void{
t.reset();
t.start()
}
function timeoutF(e:TimerEvent):void{
// do whatever because of mouse inactivity
t.removeEventListener(TimerEvent.TIMER,timeoutF);
t=null;
}
Thanks again.
I have other question:
I am in the main swf and a second, third... swf are loaded, when the timer is over how can I remove this second, third... swf and come back to main swf?
Other one If I am in the main swf and the timer is over how can I stay in the main swf?
Many many thanks to you.
North America
Europe, Middle East and Africa
Asia Pacific