0

In my flex application, I'm using an event listener for session out in idle state. It's not working for me.

Here is my code:

I have placed below code in a method

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

and the calling function onUserIDLE

private function onUserIDLE(e:FlexEvent):void
{           
    if(e.currentTarget.mx_internal::idleCounter == 60000)
    {
        this.systemManager.removeEventListener(FlexEvent.IDLE,onUserIDLE);
        Alert.show("Session time Out");
        menuRO.logoutUser();
        signOutBtn_clickHandler();          
    }
}

The above code doesn't work for my application, it's not entering the if(e.currentTarget.mx_internal::idleCounter == 60000) statement. Kindly give me suggestions.

Thanks in advance!

Art
  • 831
  • 3
  • 8
  • 26
Aravinth
  • 363
  • 2
  • 10
  • 33
  • Please refer link [Custom User Idle](http://sandeepsamajdar.blogspot.in/2012/12/custom-user-idle-handler-flex.html) – Samajdar Dec 13 '12 at 11:22

2 Answers2

2

According to this post, it appears that the idleCounter has changed (which can always happen with mx_internal components), so I guess you'd have to roll your own timer.

Community
  • 1
  • 1
AlBirdie
  • 2,071
  • 1
  • 25
  • 45
0

Since Flex SDK is open source you can always dive into SystemManager (as well as WindowedSystemManager) class sources to see that idle logic is still there (I checked SDK v.4.6.0) and it works fine. According to your conditional statement were you really waiting for 100 minutes to see if it goes inside IF-block? Anyway you can always use trace to track idleCounter value. But if you sure in your code then it'll be helpful to know which version of flex SDK and which version of FlashPlayer you're using.