First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: Ogier Schelvis | Website: http://www.rotterdamnlightning101.tk

Ok I'm gonna make it brief...

In order to make the time & date appear in Flash you have to do the next:

First, make a dynamic text box. for the variable name, type in textdate. then, make it into a movieclip (F8). Right-click on it, and click edit. Make two layers inside the movieclip. Don't change the name on layer 1, but for layer 2, call it actions. On layer 1 (the one with the dynamic text box in it), make a frame (F5) on frame 2, and make two keyframes in the actions layer. On frame 1 on the actions layer, put in the following extremely long script.

function howlong(arg) {
if (length(arg)==1) {
arg = "0" + arg;
return arg;
}
else {
arg = arg;
return arg;
}
}
myDate = new Date();

hr = howlong(String(myDate.getHours()));
mnt = howlong(String(myDate.getMinutes()));

daytext = myDate.getDay();
dd = myDate.getDate();
mm = myDate.getMonth();
yyyy = myDate.getFullYear();

switch (daytext) {
case 0: daytext = "Sunday";
break;
case 1: daytext = "Monday";
break;
case 2: daytext = "Tuesday";
break;
case 3: daytext = "Wednesday";
break;
case 4: daytext = "Thursday";
break
case 5: daytext = "Friday";
break;
case 6: daytext = "Saturday";
break
}

switch (mm) {
case 0: mm = "January";
break;
case 1: mm = "February";
break;
case 2: mm = "March";
break;
case 3: mm = "April";
break;
case 4: mm = "May";
break
case 5: mm = "June";
break;
case 6: mm = "July";
break
case 7: mm = "August";
break
case 8: mm = "September";
break
case 9: mm = "October";
break
case 10: mm = "November";
break
case 11: mm = "December";
break
}

textdate = (hr + ":" + mnt + " - " + daytext + "," + dd + " " + mm + " " + yyyy)

On frame 2 of the actions layer, put in the following script.

gotoAndPlay(1);

That's it! If you speak a different language than english and would like it to be let's say in german then you have to change the month and the day names "December", "Sunday" etc. into the german words for it "December" becomes "Dezember" and "Sunday" becomes "Sonntag"!

Hope it works for you!

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

» Level Basic

Added: 2003-03-24
Rating: 6.95 Votes: 92
(10 being the highest)
» Author
Nothing interesting... Just that I'm from the Netherlands!
» 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.