Flashvault.net

Digital Clock

2.8.2006, 0:38    Total views: 19154
Time is money, and it is always helpful to know what time it is. Exactly this tutorial will teach you how to create a digital clock with date. For this tutorial I'll using flash8.



Step 1

Start by creating a 250x70px document in flash.

Step 2

Take the Text Tool (T), in the Properties Panel (Ctrl+F3) set the Static Text and somewhere on the stage type Time, and beneath Time, type Date. Look at the pictures below!







Step 3

After that take again the Text Tool (T), in the Properties Panel (Ctrl+F3) set Dynamic Text, and using drag and drop technique, draw two "rectangles" that will represent Time and Date. Look at the picture below and everything will be clear!



Step 4

Then select that two "rectangles" and press F8 on the keyboard to convert it into a Movie Clip. Look at the picture below!



Step 5

Double click on the new made Movie Clip ("rectangles"),or right click and choose Edit in Place.



Step 6

Select after that "rectangle" for Time, open the Properties Panel (Ctrl+F3), and under var: type time. Look at the picture below!





Step 7

Select "rectangle" for Date and in the Properties Panel (Ctrl+F3) under var: type date.



Step 8

Go back on the main scene (Scene1), select the "rectangles" (Movie Clip), open the Action Script Panel (F9) and paste this script:

onClipEvent (load) {
 days = new Array('Sunday','Monday','Tuesday','Wednesday','thursday','Friday',
'Saturday','Sunday');
 months = new Array('January','February','march','April','May',
'June','July','August','September','October','November','December');
 timedate = new Date();
}

onClipEvent (enterFrame) {
 hour = timedate.getHours();
 minutes = timedate.getMinutes();
 seconds = timedate.getSeconds();
 todaydate = timedate.getDate();
 day = timedate.getDay();
 dayname = days[day];
 month = timedate.getMonth();
 monthname = months[month];
 year = timedate.getFullYear();
 if (Length(minutes)==1) {
  minutes = "0" + minutes;
 }

 if (Length(seconds)==1) {
  seconds = "0" + seconds;
 }

 time = hour + ":" + minutes + ":" + seconds;
 date = dayname + " " + todaydate + " " + monthname + " " + year;
    delete timedate;
 timedate = new Date();
}


Test your Movie, we're done!

Download source file (.fla)
Have questions about this tutorial?
Visit our friendly Community Forums!
Digg it! Add this tutorial to del.icio.us! Furl it! Add this tutorial to reddit! Spurl it! Add this tutorial to technorati!

Forum - Newest Discussions

Convert AVI Video to Flash
Last post by: linddy
Date: 29.11.2008 04:40:55

photogallery
Last post by: trnghosn
Date: 26.11.2008 16:22:19

For Sale Brand NewHTC Touch HD $380Samsung i900 Om
Last post by: so100
Date: 25.11.2008 13:01:33

For Sale Brand NewHTC Touch HD $380Samsung i900 Om
Last post by: so100
Date: 25.11.2008 13:00:48

Waiting for your hour of triumph? It is near!
Last post by: VitaMary
Date: 21.11.2008 18:46:41

Yeow dogs!
Last post by: deco11
Date: 21.11.2008 01:15:49

Show your girlfriend what a real sex is!
Last post by: VitaMary
Date: 20.11.2008 22:00:13

Regarding the Gradient by Mouse Tutorial...
Last post by: cloudy-days
Date: 19.11.2008 07:41:03

Open flash cs3 fla in flash 8???
Last post by: benjezza
Date: 14.11.2008 23:41:46

Related links