Groups | Blog | Home
all groups > flash (macromedia) > october 2005 >

flash (macromedia) : Making a ticker / counter


LeifKolt
10/13/2005 10:17:52 PM
Hi i'm working on a site that is going to have a counter on it that shows the
amount of people being put in jail for marijuana crimes, from the starting date
of posting the site.
So lets say i put the site up today, starting from when it is posted on the
web, i want the counter to start at 0 and every 42 seconds add 1 to the total.
So that even if people aren't viewing the site, it is adding to the total, and
over time the number will become huge.

anyone know how i can do this in flash??
thanks

Leif


NSurveyor
10/13/2005 10:34:34 PM
See how many seconds has passed between the START date and NOW date. Then you
can determine the number of people put in jail...

for example:

startDate = new Date(2005, 0, 1); // January 1, 2005
onEnterFrame = function () {
endDate = new Date(); // Today
seconds = (endDate-startDate)/1000;
jail = Math.floor(seconds/42);
trace("There have been "+jail+" people who have gone to jail for marijuana
crimes");
};

It would work much better if you could get the time from the server...
AddThis Social Bookmark Button