FORUMS: list search recent posts

how to return to the beginning after no activity

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kelly Oliver
how to return to the beginning after no activity
on Mar 29, 2010 at 6:41:20 pm

I'm creating a flash file for a kiosk and need to know how to create action script that will take the user back to the beginning after 1 minute of no activity. Thanks!!!


Return to posts index

Adam Ashby
Re: how to return to the beginning after no activity
on Mar 29, 2010 at 10:15:42 pm

In AS3, I would use the timer class.

import flash.utils.Timer;

var timer:Timer = new Timer(60000,1); //1st arguement is delay time in millieconds, 2nd repeat count
timer.addEventListener(TimerEvent.TIMER, startOver);
timer.start();

function startOver(e:TimerEvent):void{
gotoAndStop(1);
}


And if the user does do something within that time frame add the following to whatever function to stop, reset and start the timer again.

timer.reset();
timer.start();



Adam Ashby
mutli-media artist
http://www.adamashby.com


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]