Lebanon web design, development, hosting , seo, email marketing and E-commerce solutions
How to make date & time appear in Flash MX! PDF Print E-mail
User Rating: / 0
PoorBest 

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);
Hope it works for you!
 
< Prev