First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Van_pl
The previous page didn't stisfied you, eh? Ok, now we will make days, months, and years.

1. Edit a movie clip, and add a second dynamic text to it. Give it instance name of 'czas2'.
2. Now delete all code from your movie clip and paste this:

onClipEvent (enterFrame) {
	data = new Date();
	rok = data.getFullYear();
	miesiac = data.getMonth();
	tydzien = data.getDay();
	dzien = data.getDate();
	godziny = data.getHours();
	minuty = data.getMinutes();
	sekundy = data.getSeconds();
	milisekundy = data.getMilliseconds();
	if (sekundy<10) {
		sekundy = "0"+sekundy;
	}
	if (minuty<10) {
		minuty = "0"+minuty;
	}
	if (godziny<10) {
		godziny = "0"+godziny;
	}
	if (dzien<10) {
		dzien = "0"+dzien;
	}
	if (miesiac == 0) {
		miesiac2 = "Jan";
	}
	if (miesiac == 1) {
		miesiac2 = "Feb";
	}
	if (miesiac == 2) {
		miesiac2 = "Mar";
	}
	if (miesiac == 3) {
		miesiac2 = "Apr";
	}
	if (miesiac == 4) {
		miesiac2 = "May";
	}
	if (miesiac == 5) {
		miesiac2 = "Jun";
	}
	if (miesiac == 6) {
		miesiac2 = "Jul";
	}
	if (miesiac == 7) {
		miesiac2 = "Aug";
	}
	if (miesiac == 8) {
		miesiac2 = "Sep";
	}
	if (miesiac == 9) {
		miesiac2 = "Oct";
	}
	if (miesiac == 10) {
		miesiac2 = "Nov";
	}
	if (miesiac == 11) {
		miesiac2 = "Dec";
	}
	if (tydzien == 0) {
		tydzien2 = "Sun";
	}
	if (tydzien == 1) {
		tydzien2 = "Mon";
	}
	if (tydzien == 2) {
		tydzien2 = "Tue";
	}
	if (tydzien == 3) {
		tydzien2 = "Wen";
	}
	if (tydzien == 4) {
		tydzien2 = "Thu";
	}
	if (tydzien == 5) {
		tydzien2 = "Fri";
	}
	if (tydzien == 6) {
		tydzien2 = "Sat";
	}
	if (miesiac == 11 or miesiac == 0 or miesiac == 1) {
		_root.pora.gotoAndPlay("zima");
	}
	if (miesiac == 2 or miesiac == 3 or miesiac == 4) {
		_root.pora.gotoAndPlay("wiosna");
	}
	if (miesiac == 5 or miesiac == 6 or miesiac == 7) {
		_root.pora.gotoAndPlay("lato");
	}
	if (miesiac == 8 or miesiac == 9 or miesiac == 10) {
		_root.pora.gotoAndPlay("jesien");
	}
	if (godziny != 0) {
		_root.pora2.gotoAndPlay(godziny);
	} else {
		_root.pora2.gotoAndPlay(25);
	}
	czas = godziny+" : "+minuty+" : "+sekundy;
	czas2 = "A.D. "+rok+"  "+tydzien2+" "+dzien+" "+miesiac2;
}


3. Code between last 3 lines and 'tydzien2="sat";' tells about time of year and time of day, wich we will learn about at next page.
4. Save, and test. It's working ^^!
5. To change form of display of time or date, edit lasy 3 lines of code for example :
czas= godziny+"hrs "+sekundy+"secs "+minuty+"mins";

it will look like this. If you have hour 20:15:30, then your clock will display it like this: 20hrs 30secs 15mins
Possible changes are infinite!
6.To prevent Accident(tm), just save your work and test it (file/publish preview/flash)
» Level Intermediate

Added: 2005-11-09
Rating: 5 Votes: 6
(10 being the highest)
» Author
Ehhh, lol? :P I love pizza and hentai :P
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.