2 Replies Latest reply on Jan 23, 2011 7:15 PM by Shongrunden

    How to detect when the os comes out of "sleep"

    rakmaster Level 1

      I have a timer running that sets an event to fire at certain intervals. Apparently, when the computer os goes to sleep it kills the timer. I need it to start up when the computer wakes up again, or better yet, keep firing while the computer is asleep. I found one solution at stackoverflow.com, but the solution doesn't make sense to me.


      The answer was to set a timer with a shorter cycle, then have that timer check against a "time to fire" in the future. If the timer in Flex gets shut down on "sleep" then setting a shorter timer cycle doesn't seem like it would solve anything, because the timer gets killed no matter what. What good does setting a timer to check against a system clock time do if the timer gets killed when the system goes to sleep?


      The only other answer I've found is forcing the system to stay "awake" while my app is running, but this seems a bit invasive.


      So, my question is, how do I set an event listener to detect when the system (os) wakes up?