First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
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: S.Saipriya
» Title: Flash Fire Effect
» Description: This tutorial explains about how to create Fire Effect in Flash of Actionscript 2.0.I hope this tutorial helps you!
Featured Sound Loops
Image for equalize

Audio Player

» Author: Aidan Crouzet-Pascal
» Title: Falling Star
» Description: This loop is a cool sounding, E minor loop.
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: Brandan Paulin
» Description: Epic sounding loop with Brass, Percussion, Strings and Winds. This is actually part of a Loop Pack called the Coming where you can download the rest of the loops that go with it FREE from my website.