I think Ralf is right, good luck to the OP.
setTimeout()function public function setTimeout(closure:Function<http://livedocs.adobe.com/flex/2/langref/Function.html>, delay:Number <http://livedocs.adobe.com/flex/2/langref/Number.html>, ...<http://livedocs.adobe.com/flex/2/langref/statements.html#..._%28rest%29_parameter>arguments): uint <http://livedocs.adobe.com/flex/2/langref/uint.html> Runs a specified function after a specified delay (in milliseconds). Instead of using this method, consider creating a Timer object, with the specified interval, using 1 as the repeatCount parameter (which sets the timer to run only once). If you intend to use the clearTimeout() method to cancel the setTimeout()call, be sure to assign the setTimeout() call to a variable (which the clearTimeout() method will later reference), as in the following: var my_timedProcess:uint = setTimeout(my_delayedFunction, 1000); // ... clearTimeout(my_timedProcess); On 10/2/07, Ralf Bokelberg <[EMAIL PROTECTED]> wrote: > > Like this maybe? > > <mx:Button click="handleClick(event)" .../> > > function handleClick( event : Event ) : void > { > setTimeout( doButtonAction, 3000 ); > } > > function doButtonAction() : void > { > trace("doButtonAction"); > } > > Cheers > Ralf. > > > On 10/2/07, Willy Ci <[EMAIL PROTECTED] > wrote: > > > > my guess is OP need a delay function, > > like after user click a button, wait three seconds, > > then update the screen. > > > > > > On 10/2/07, Paul Andrews < [EMAIL PROTECTED]> wrote: > > > > > > Traditionally, a sleep() function stops the code in it's tracks and > > > then resumes after a delay. Timer Events can't give you exactly that > > > behaviour. > > > > > > I can understand wanting to delay processing for a while, but in an > > > event driven environment it may not be what's needed. Usually I associate > > > timed events with doing screen updates for animation, or timing out some > > > pending event that's taking too long. > > > > > > I was curious what the OPs intention was since they explicitly asked > > > about stopping processing. > > > > > > Paul > > > > > > ----- Original Message ----- > > > *From:* Willy Ci <[EMAIL PROTECTED]> > > > *To:* [email protected] > > > *Sent:* Tuesday, October 02, 2007 12:43 PM > > > *Subject:* Re: [flexcoders] Sleep() method > > > > > > there is a lot of use for sleep function. > > > you can try use flash.events.TimerEvent write your own sleep(). > > > as3 doesn't have it own sleep function. > > > > > > Willy > > > > > > > > > On 9/28/07, Paul Andrews <[EMAIL PROTECTED]> wrote: > > > > > > > > ----- Original Message ----- > > > > From: "essuark" <[EMAIL PROTECTED]> > > > > To: < [email protected]> > > > > Sent: Friday, September 28, 2007 9:11 PM > > > > Subject: [flexcoders] Sleep() method > > > > > > > > > Is this something like a sleep or wait method? A method that holds > > > > > > > > > processing for 'n' seconds? I could use a timer but that doesn't > > > > stop > > > > > the processing. > > > > > > > > > > thanks > > > > > r > > > > > > > > What processing are you trying to stop and why? > > > > > > > > > > > > > > > > -- > > > Willy > > > > > > ---------------------------------------------------------------------- > > > maybe today is a good day to write some code, > > > hold on, late me take a nap first ... Zzzz > > > > > > Q: How do you spell "google"? > > > A: Why don't you google it? > > > ---------------------------------------------------------------------- > > > > > > > > > > > > > > > -- > > Willy > > > > ---------------------------------------------------------------------- > > maybe today is a good day to write some code, > > hold on, late me take a nap first ... Zzzz > > > > Q: How do you spell "google"? > > A: Why don't you google it? > > ---------------------------------------------------------------------- > > > > > > > -- > Ralf Bokelberg <[EMAIL PROTECTED]> > Flex & Flash Consultant based in Cologne/Germany > Phone +49 (0) 221 530 15 35 > > > -- Willy ---------------------------------------------------------------------- maybe today is a good day to write some code, hold on, late me take a nap first ... Zzzz Q: How do you spell "google"? A: Why don't you google it? ----------------------------------------------------------------------

