make sure u remove the event listener too , u keep repeating by adding them 
every time but you never remove them when they are done.


----- Original Message ----
From: Luke Vanderfluit <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, May 28, 2008 8:15:54 PM
Subject: Re: [flexcoders] popup timeout


Hi

I solved this one as follows:
See the code (changed) below, Basically the timer needs to be stopped for it to 
run its 
entire 2 seconds each time...

Haha Viva Flex!

Kr.
Luke.

Luke Vanderfluit wrote:
> Hi.
> 
> Im trying to get a popup that says "Details Saved" when I save data.
> The popup should stay up for 2 seconds and then go away.
> 
> I currently have the following code:
> 
>              private var puWin:IFlexDisplayO bject;

private var myTimer:Timer;

> 
>              private function sdPopup():void {
>                  puWin = PopUpManager. createPopUp(
>                          this, DetailsSavedPopup, true);
myTimer:Timer = new Timer(2000, 0);
>                  myTimer.addEventLis tener("timer" , timerHandler) ;
>                  myTimer.start( );
>              }
>              public function timerHandler( event:TimerEvent ):void {
>                  PopUpManager. removePopUp( puWin);
myTimer.stop( );
>                  //trace("timerHandl er: " + event);
>              }
> 
> 
> The problem here is that the times are not consistent.
> The first time I save the timeout is 2 seconds, then if I save again 
> (immediately or after 
> 5 seconds or so) the popup barely stays up at all, then on continued saves, 
> it's 
> inconsistent. ..
> 
> Is there anything in the code causing this?
> Is there another (simpler way of doing this);
> 
> 
> This is my popup component:
> <?xml version="1.0" encoding="utf- 8"?>
> <mx:TitleWindow xmlns:mx="http://www.adobe. com/2006/ mxml"
>               width="200" height="100" >
>       <mx:Text text="Details Saved..."
>                       x="47.5" y="33"
>                       width="105" height="35"
>                       fontWeight=" bold"/>
> </mx:TitleWindow>
> 
> Kr.
> Luke.
> 

-- 
Luke Vanderfluit
Analyst / Web Programmer
e3Learning.com. au
08 8221 6422
    


      

Reply via email to