Counting to a certain year

Hi there

Can someone tell me how to create the smallest file possible, containing a movie in which it counts to a certain year?
E.g. a movie where the numbers run for a while, stopping at the year 2001?
I’ve tried several ways, but I’m sure there must be a more easy and more simple way using actionscript.
Searching the forums didn’t help (but then again maybe I was using the worng keywords…). Thanks!

Paul

(thanks for the ‘Date Countdown Timer’-tutorial made by Senocular used as an example)

It’d be easier if you just used a dynamic text field instead of images; then all you would have to do is use actionscript to calculate a variable, have that variable be the year, and then have the dynamic text field display that variable.

I guess I’m not really clear what you want them to do … do you want them to keep going in sequence for awhile and then stop when they get to the right one or…?

Yep, that’s right. Just ‘rolling’ for a short while and then stop at the year 2001.

OK, using actionscript instead of pics is fine with me. But could you please tell me what are the right codes to be used then? (if it isn’t too much trouble, that is!) Thanks.

Paul

Something like this?
Set the date its counting down to in this line:

  
eventDate = new Date(thisYear, 7, 18, 18, 45);

Date = aug, since it starts with jan on 0.
then the day = 18th, and the time = 18.45

You might need some changes, but that was what i had .

No, I’m sorry. It hasn’t got anything to do with actual counting up or counting down.
It’s just a movie which stops counting at the whole year of 2001 (and no minutes, seconds etc.)…

I’m not sure if you are wanting to start from the current year or something, but from what I figured you meant was just a variable that would subtract one every enterFrame, correct?

you could then just use

[AS]mc.onEnterFrame = function() {
if(year>2001) {
year.text=year;
}}[/AS]

What I mean is something like this movie, only much more simple (=less kb!).

ok heres a sucky way of doing it but hey…

function bump(){
	q++
	w++
	e++
	r++
	if(q>9){
		q=0
	}
	if(w>9){
		w=0
	}
	if(e>9){
		e=0
	}
	if(r>9){
		r=0
	}
	x++
	if(x==12){
		clearInterval(bumpV)
	}
}
if(initVar!=true){
	x=0
	q=0
	w=8
	e=8
	r=9
	initVar=true
	bumpV = setInterval(bump,75)
}

put that in the first frame of your timeline and ensure there are 4 dynamic text boxes with variable values “q”, “w”, “e”, “r” respectively (without the quotes) the

bumpV = setInterval(bump,75)

sets the interval that calls the function that rolls the numbers… change the integer at the end to spped up/slow down the rolling… and the

if(x==12){

determines when to stop the function… so just change this value to whatever you want if you want it to cycle more/less…

this will emulate what you had in your fla but using actionscript and text boxes rather than movie clips and images :wink:

good luck mate

Prophet.