5 Replies Latest reply on Aug 3, 2011 5:26 AM by ahmadmumtaz134

    Help with Felx.IDEL event


      Hi Folks,


      I am a newbie in Flex and I used an example on Flex.IDLE event from
      http://inflagrantedelicto.memoryspiral. … nt-page-1/
      to logout a user after some specific idle interval.


      What is happening with me is


      1. When browser window is minimized, this event doesn’t trigger.
      2. When some flash contents are running in same or different browser, this event sometime fires and sometimes not.


      Can anyone help me out in figuring out why this is happening and how I can fix it. Please help me.


      Thanks in Advance.

        • 1. Re: Help with Felx.IDEL event

          the IDEL event "Dispatched every 100 millisecondes when there has been  no keyboard or mouse activity for 1 second"

          1 person found this helpful
          • 2. Re: Help with Felx.IDEL event
            ahmadmumtaz134 Level 1

            Many many thanks for your quick response. this is mentioned in the example I have followed.Please look at my scenario 1 and 2. I am working while Flex application window minimized. After some time, I came back to my minimized window and restore it and I see that no logout method is called which is registered with Flex.IDEL event. When I leave my machine (whole system) IDEL, then this event occurs fine.

            • 3. Re: Help with Felx.IDEL event
              zhanglog Level 1

              when did you add the linstener of IDLE event?

              I've done a experiment :if put the code "systemManger.addEventLinster(FlexEvent.IDLE,handler)"  after the addToStage event has been dispatched in application,that works well

              • 4. Re: Help with Felx.IDEL event
                ahmadmumtaz134 Level 1

                I register this event when a user successfully logged into the application. You mean to say that if I add this event after the "addToStage", then it will work fine even if browser window is minimized? Let me try and I'll let you know my output.


                Thanks a lot for your time and quick responses.



                • 5. Re: Help with Felx.IDEL event
                  ahmadmumtaz134 Level 1

                  Thanks alot for your help. Now it is working but again there's something else problem

                  for setting one minute timeout interval I using following formaula


                  var TIME_OUT_LIMIT:int = (1000*60*1)/100;


                  below is my logout code


                  public function logoutUser(e:FlexEvent):void{
                       use namespace mx_internal;             
                       if(e.currentTarget.mx_internal::idleCounter >= TIME_OUT_LIMIT){
                            Alert.show(new Date().toTimeString());                       
                            this.systemManager.removeEventListener(FlexEvent.IDLE, removeFlexIdelEvent);         


                  when browser window is minimized, logoutUser method is called after inteval 5 times greater than the TIME_OUT_LIMIT. Can you tell me what's wrong I am doing.