0 Replies Latest reply: Jun 10, 2013 8:42 AM by Stewart TVDSB RSS

    How to track clients idle time and force to Login View

    Stewart TVDSB

      How can I force clients to the Login View after a period of idle time ( 1 hour). My mobile application consist of many views and need  the time out to work from any view. Your assistance is appreciated.Using Flash Builder 4.5 and AS 3.0.


      I was able to make it work using FlexEvent.Idle to determine the inactivity. But it only works when I am on the second view, if I go deeper (third view) it fails. Here is the code I am using and the error I get




      protected function view1_creationCompleteHandler(event:FlexEvent):void


           this.systemManager.addEventListener(FlexEvent.IDLE, userIdle);





      private function userIdle(e:FlexEvent):void


         if(e.currentTarget.mx_internal::idleCounter == 200)


          //do something!








      • TypeError: Error #1009: Cannot access a property or method of a null object reference.
      • at views::MainMenu/userIdle()[C:\Documents and Settings\spences\Adobe Flash Builder 4.5\EmployeeLogin\src\views\MainMenu.mxml:89]
        • at flash.events::EventDispatcher/dispatchEventFunction()

        • at flash.events::EventDispatcher/dispatchEvent()

        • at mx.managers::SystemManager/idleTimer_timerHandler()[E:\dev\4.5.1\frameworks\projects\fram ework\src\mx\managers\SystemManager.as:3292]

        • at flash.utils::Timer/_timerDispatch()


      at flash.utils::Timer/tick()


      Message was edited by: Stewart TVDSB