3 Replies Latest reply on Dec 29, 2008 11:00 AM by sig_UVA

    flex inactivity timer

      I found this blog post (see below) about using the FlexEvent.IDLE event to create and inactivity timeout. However, I am running into problems with this line:
      this.systemManager.addEventListener(FlexEvent.IDLE, userIdle);

      FB3 throws and error about how I can't use the "this" keyword. I put this line after the import statements. Should I put it somewhere else?

      Text Link to Blog

      Thanks for your help!
        • 1. Re: flex inactivity timer
          John Hall Level 4
          I'm running out the door or it would be a fun experiment to play with. However, I remembered using something similar before that I got off of a Japanese blog, which is below. Looks like they added event listeners for mouse and keyboard, which I wouldn't think would be necessary by definition of idle but maybe you can reverse engineer something from this working example.
          • 2. Re: flex inactivity timer
            John Hall Level 4
            OK. Took a look upon return and here's how it can be used if inside an mxml document. It's probably that the blog spoke to creating a timer inside a class file rather than in the context of an mxml file, where you would not have the addEventListener by itself outside of a function). Here I just fire off the init function upon the application being totally created.

            • 3. Re: flex inactivity timer
              sig_UVA Level 1
              Thank you! I'll try this out and let you know how it works.