First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Ogier Schelvis | Website:

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";
case 1: daytext = "Monday";
case 2: daytext = "Tuesday";
case 3: daytext = "Wednesday";
case 4: daytext = "Thursday";
case 5: daytext = "Friday";
case 6: daytext = "Saturday";

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

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

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


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.88 Votes: 93
(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!


  • 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.