Articles published in Februar, 2010

JavaScript Timer Class

Here is a little JavaScript Class which allows you to have timed function calls. Of course there could be different instances of these timers. Here is a example how to use it:

var timer = new Timer( {'interval':1000} );
timer.start( timedFunction );
 
function timedFunction(){
   // called every 1000 milliseconds
}

The function timedFunction will be called every 1000 milliseconds. The millisecond interval will be configured within the configuration object, which is given as parameter into the the class constructor. There is also an optional second parameter for the start function to set the scope. This allows you to use the timer within other JavaScript objects. To stop the timer use the stop function.

Search:

Twitter

XING

Flex User Group Hamburg

Gallery

IMG_3297_grey IMG_1468 IMG_1880 IMG_4219_grey IMG_3546 IMG_8638 IMG_3467 IMG_3136 IMG_2601 IMG_6093 img_1078_gs IMG_3559_grey

Latest Comments

Latest Article

Categories

del.icio.us