you're absolutely right - this is just a way to execute function once 
after given time. one can extend this code to something like this:

var bool = true;

function mystart(){
        bool = false;
        clearInterval(intrvl);
  }
  var intrvl = setInterval(mystart,2000);

while(bool){
  // do noting
}
// here the rest of the code



but there is still some execution going on in the "while" loop

krzysiek

> Sure.  My point is just that you cannot use it to make *execution* 
> wait/pause, in a function for example.  Processing continues during the 
> interval.
> 
> Tracy
> 
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of 
> Krzysztof Szlapinski
> Sent: Monday, September 12, 2005 2:32 PM
> To: [email protected]
> Subject: Re: [flexcoders] pausing for given time
> 
> Tracy Spratt napisaƂ(a):
> 
>>setInterval() does not pause exzecution, it just executes a function at a 
>>specified time interval.
> 
> 
> You're right but when used with clearInterval you can achieve something 
> similar to pause. this is sample code (pausing for 2 seconds):
> 
> function mystart(){
>       alert("And my heart will go on and on ... :)");
>       clearInterval(intrvl);
> }
> var intrvl = setInterval(mystart,2000);
> 
> krzysiek
> 
> 
> 
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to