Aravinth
Aravinth

Reputation: 363

Flex idle application to session time out

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!

Upvotes: 0

Views: 2560

Answers (2)

Vitali Bozhko
Vitali Bozhko

Reputation: 96

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.

Upvotes: 0

AlBirdie
AlBirdie

Reputation: 2071

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.

Upvotes: 2

Related Questions