You are adding an event listener every time yu click the button. I don't know that this is the problem but it makes me suspicious. Either remove the event listener in the success condition, or add it one time in an init function. See if that chnges the behavior.
Other than that, simplify the setup to the minimum and see if the issue continues. Tracy Spratt Lariat Services Flex development bandwidth available ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of trishhartnett Sent: Wednesday, February 18, 2009 1:38 PM To: [email protected] Subject: [flexcoders] Help with Timer issue Hello all, I'm a Flex newbie. I'm working on an application where an end user clicks a button, and when the button is clicked a DB is queried repeatedly until a particular result is returned. When the result is returned the end user gets a confirmation message to tell them that they were successful. So the code goes like this: private var dBTimer:Timer = new Timer(5000); private function onButtonClick(): void{ dBTimer.addEventListener(TimerEvent.TIMER, timeTick); dBTimer.start(); } public function timeTick(evt:TimerEvent):void { checkStatus(callBackFunction, id); } private function callBackFunction():void { if( status == 'SUCCESS' ) { // cancel the timer dBTimer.stop(); dBTimer.reset(); Alert.show("Succcess string","Info","OK",null,null,INFO_ICON); }else{ //do nothing and the checkStatus //will be called again at next TimerEvent } } So the first time the end user clicks on the button, everything works okay. The DB is queried and when SUCCESS is returned the dBTimer is stopped and reset. The end user gets the Success Alert dialog box and everything is okay. The second time the end user clicks the button, everything happens the same as before, only the dbTimer, despite being stopped doesn't stop working. checkStatus is called over and over again in an infinite loop because the dbTimer never stops. Can anyone suggest anything please ? I am really puzzled by this one. Best Regards, Trish.

