Skip to main content
May 26, 2013
Question

Action Script code to restart app at regular time intervals

  • May 26, 2013
  • 1 reply
  • 365 views

I am hoping someone more versed in action script 3 for air can help me!

I have an app, which I am planning to display on the ipad at an exhibition. Would I be able to add some code to the action script,
which will restart the app after a certain amount of time (say 5 minutes) if it has not been interacted with i.e. the screen has not been touched?

I would be very grateful if someone could help me with this

This topic has been closed for replies.

1 reply

Inspiring
May 28, 2013

Will something like this help..

in this example ive just placed a blank movie clip on stage. instance name mc.

mc.visible = false;

var timer:Timer = new Timer(5000);//Five Seconds

timer.start();

timer.addEventListener(TimerEvent.TIMER, showMsg);

stage.addEventListener(MouseEvent.MOUSE_DOWN, stopTimer);

// If there is no activity for 5 seconds mc will become visible

function showMsg(e:TimerEvent):void

{

    mc.visible = true;

}

//If there's activity, mc will bwcome invisible

function stopTimer(e:MouseEvent):void

{

    mc.visible = false;

    timer.stop();

    timer.start();

}