Search tutorials
Ok lets start. First you need create a movie clip. Then create inside
the movie clip four dynamic textboxes; one for hours, one for minutes, one for moths and one for days. Then give variable Names to hours, minutes, days and months textboxes(i used hrs, min, day, month. Then type two numbers to hours, minutes and days textboxes, and example FEB to moths textbox.
Lastly move the movie clip to the main scene.
Ok, lets move on to the script:
copy and paste this script to the movie clip on the main scene(click the movie clip and open Actions window):
onClipEvent(enterFrame)
{
time = new Date();
hrs = time.getHours();
min = time.getMinutes();
day = time.getDate();
month = time.getMonth();
if(min<10) {min="0" + time.getMinutes();}
else if(hrs<10) {hrs="0" + time.getHours();}
if(month=="0") {month="JAN"}
else if(month=="1") {month="FEB"}
else if(month=="2") {month="MAR"}
else if(month=="3") {month="APR"}
else if(month=="4") {month="MAY"}
else if(month=="5") {month="JUN"}
else if(month=="6") {month="JUL"}
else if(month=="7") {month="AUG"}
else if(month=="8") {month="SEP"}
else if(month=="9") {month="OCT"}
else if(month=="10") {month="NOV"}
else if(month=="11") {month="DEC"}
}
Funny thing is that Flash things that january is in numbers "0", thats why we have to chance "0" to JAN, or you can otherwise just chance it to "1" and to everyone of them(1,2,3,4,5...)
And if the clock is 05:09, flash makes it to 5:9, so we have to add those extra sripts which is shown above:
if(min<10) {min="0" + time.getMinutes();}
else if(hrs<10) {hrs="0" + time.getHours();}
Well done, thats it!
| » Level Basic |
|
Added: 2005-02-04 Rating: 3 Votes: 10 |
| » Author |
| Student |
| » Download |
| Download the files used in this tutorial. |
| Download (0 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


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