Guys-
I have what I THINK is a simple problem here. I'm calling a basic timer on login success, followed by setting up a couple handlers to refresh some data on a schedule. (I haven't pasted the timer handlers cause i don't think it matters what they do) Anyway, I'm trying to shut OFF those timed refreshes when the app is IDLE, but this:
if (e.currentTarget.mx_internal::idleCounter > 15000) {
Never gets triggered. I presume it's because of the different way Flex 4 is handling these objects, but I can't find it anywhere in the documentation. Searching for idleCounter comes up empty, even.
protected function getUserByIDResult_resultHandler(event:ResultEvent):void
{
var sysMan:ISystemManager = FlexGlobals.topLevelApplication.systemManager;
sysMan.addEventListener(FlexEvent.IDLE, userIdle);
session.user = event.result as User;
timer = new Timer(5000);
timer.addEventListener(TimerEvent.TIMER, timer_short);
timer.start();
timer2 = new Timer(10000);
timer2.addEventListener(TimerEvent.TIMER, timer_long);
timer2.start();
currentState='Main';
}
private function userIdle(e:FlexEvent):void {
if (e.currentTarget.mx_internal::idleCounter > 15000) {
timer.stop();
timer2.stop();
}
if (e.currentTarget.mx_internal::idleCounter < 15000) {
if ( timer.running == false) {
timer.start();
timer2.start();
}
}
}