Tuesday, February 10, 2009

timer

heeey, long time no see right ?!

more than a week now. so i decided bringing yall something cool. a timer !!
lets get to it.

use the text tool to make a dynamic text box. and on the var field, type clock.

than, on the main timeline, type these actions:

clock = 0;
timer = function () {
clock += 1;
};
timeclock = setInterval(_root.timer, 1000);

you see that code ? it says that every 1000 miliseconds ( 1 second ) the clock variable is gonna increase 1.
what we did is creating a function that increases clock by 1. than the setInterval function did all the rest.
try experimenting with those variables =]

here is a fast timer i made:




0 comments:

Post a Comment