AS3 Timer replica for JavaScript
Function(TimerEvent e) - Listener callback function.
Here is an example that is also featured in the Dragdealer JS page, you can find the Dragdealer code for it over there. This is just the part for setting up the Timer.
var timer = new Timer(3000);
timer.addEventListener(TimerEvent.TIMER, function(e)
{
slideshow.setStep(++currentPosition % 5);
});
timer.start();
And now for the user experience, let's stop the autorotation on mouse over.
slideshowArea.onmouseover = function()
{
timer.stop();
}
slideshowArea.onmouseout = function()
{
timer.start();
}
© 2010 code.ovidiu.ch. No idiot-proof guarantee.