Two ways:

function pollServer():void {

//do polling here

if(shouldcontinuepolling) setTimeout(pollServer,1000);

}

 

Or

 

function pollServer():void {

//do polling here

}

var pollInterval:uint=null;

function onCreationComplete():void {

pollInterval = setInterval(pollServer,1000);

}

Later when you need to stop polling:

if(pollInterval!=null) { clearInterval(pollInterval); pollInterval=null; }

  _____  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mayank
Sent: Tuesday, October 02, 2007 8:33 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Sleep() method

 

I have a usecase where I need to keep polling the server for a value. How
can I achieve that without a sleep method?

On 10/2/07, Tom Chiverton < <mailto:[EMAIL PROTECTED]>
[EMAIL PROTECTED]> wrote:

On Tuesday 02 Oct 2007, [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> com wrote:
> there is a lot of use for sleep function.

There is (as opposed to setTimeout which executes a method after a delay) ?
When ?

--
Tom Chiverton
Helping to continuously restore dynamic design-patterns 
on: http://thefalken. <http://thefalken.livejournal.com> livejournal.com

****************************************************

This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and
Wales under registered number OC307980 whose registered office address is at
St James's Court Brown Street Manchester M2 2JF.  A list of members is
available for inspection at the registered office.  Any reference to a
partner in relation to Halliwells LLP means a member of Halliwells LLP.
Regulated by The Solicitors Regulation Authority. 

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may
be confidential or legally privileged.  If you are not the addressee you
must not read it and must not use any information contained in nor copy it
nor inform any person other than Halliwells LLP or the addressee of its
existence or contents.  If you have received this email in error please
delete it and notify Halliwells LLP IT Department on 0870 365 8008. 

For more information about Halliwells LLP visit www.halliwells.
<http://www.halliwells.com> com.


--
Flexcoders Mailing List
FAQ: http://groups.
<http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>
yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-
<http://www.mail-archive.com/flexcoders%40yahoogroups.com>
archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links 


    (Yahoo! ID required)

    mailto:flexcoders-fullfeat
<mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]


 

 

Reply via email to