all groups > flash (macromedia) > may 2007 >
You're in the

flash (macromedia)

group:

Want to add a timer


Want to add a timer numerical07
5/5/2007 2:32:20 PM
flash (macromedia):
I want to add a timer in my slide show so that every 10 secs or possibly
longer, my slide will change. or a tween will begin. I would like to know how
to do this in ActionScript, not any options that flash has to offer.
Re: Want to add a timer The Feldkircher
5/5/2007 3:19:22 PM
Hi

Read about setInterval in Flash Help, it will get ya started.

Re: Want to add a timer numerical07
5/6/2007 4:32:10 PM
Im a little bit confused on what the setinterval() function does exactly. what
is the I saw a example where there was a this varible scope in the setinterval
like this setinterval(this, function, duration) what is the this doing
exactly. I know that it calls on a function and the duration was 20. but 20
what ?? 20 min, hours, days ???
Re: Want to add a timer ThinkAdrian
5/6/2007 7:30:34 PM
to set a "timer" you need setInterval, which takes the function name and
interval in MILLISECONDS as parameters.

So, if you want function doThis() to be called every second, you write:

setInterval(doThis, 1000);

to be able to stop this repetition of the function you need to write this:

// to start the interval
my_interval = setInterval(doThis, 1000);

// to stop it
clearInterval(my_interval);
AddThis Social Bookmark Button