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