I'm not sure why.
Animate isn't recognizing my device so I cannot debug the app.
In this case let's go with the setTimeout approach. As an example, I have a very simple app that has two frames: the first one containing a start button and in the second one a timeout of 5 seconds is set and if the user doesn't touch the screen within 5 seconds the timeline returns to frame 1. The code is like this:
Frame 1:
import flash.events.MouseEvent;
import flash.utils.clearTimeout;
import flash.utils.setTimeout;
var delay:uint = 5000;
var timeout:uint = 0;
function main():void
{
stop();
startButton.addEventListener(MouseEvent.CLICK, start);
stage.addEventListener(MouseEvent.MOUSE_DOWN, wake);
}
function start(e:MouseEvent):void
{
gotoAndStop(2);
}
function wake(e:MouseEvent):void
{
clearTimeout(timeout);
timeout = setTimeout(idle, delay);
}
function idle():void
{
gotoAndStop(1);
}
main();
Frame 2:
wake(null);
The FLA / source / code / files is in here:
https://github.com/joao-cesar/adobe/tree/master/animate%20cc/as3/idle
I hope it helps.
Regards,
JC