3 Replies Latest reply on Aug 8, 2006 4:45 AM by Karen_Mathis

    time out

      I'm trying to have an interactive program time out. For instance if no one uses it for 2 minutes it automatically resets back to the begining. What actionscript would I use and where would I place it. I want it to reset from anywhere in the program.
        • 1. Re: time out

          maybe you could use the attached code with some other code (like an if statement if the mouse is not moving, or no clicks are happening...)
          not the *answer*, but maybe will get you going in the right direction.
          • 2. Re: time out
            macdaddy256 Level 1
            If you declare (use the Number type) and maintain a scope to the interval, you can clear it from anywhere (before the delay() function, in this case). So any valid 'interacting' event could clear the interval and restart it. Of course, all events would have to do this, and you'd have to be careful never to double the setInterval (setInterval twice or more without clearing it) - that can cause mahem.
            • 3. Re: time out
              Karen_Mathis Level 1
              Thanks! That worked.