Digital Date and Clock in Flash

Categories TutorialsPosted on

Here I’m going to tell you how to make Digital Clock in Flash, it will also be having the Date. It looks simple in Flash but we have to give some Conditions and make it according to our desire. Hopefully you will like it.

You can also visit Smooth Analog Clock to make Analog Clock in Flash.

1. First of all Take a new file in Flash. Don’t worry about the size, just take according to your desire. I’m here taking 500×200 px with 12 FPS.

2. You can use any picture for background. I’ve prepared this kind of background:

Now if you want to show date and time in single line then you will need only 1 Dynamic text and if you want to show date and time in separate lines then you have to take different Dynamic Text. As I’m going to show date and time in 3 lines then I’m going to take 3 different Dynamic Text. Just pick Text tool and before writing anything goto Property Panel and select Dynamic instead of Static. Now click anywhere in the file. Don’t write anything in it, just change the size. Likewise put other two also.

3. Now select each text one by one and give it Variable Name. For this goto Property Panel and there will be OPTION portion, here you will find Variable box, write there any name:

I’ve given First text name as ‘dayname’, second text as ‘fulldate’ and third text as ‘fulltime’. Try to avoid giving reserved name like time, date etc. So that is why I’ve used word full alongwith date and time.

5. After putting all text and objects, just press F5 key once to take another Frame, because for changing time it need another frame so that it should have a small animation.

6. Now actual part is going to start here, we are now going to give ActionScript. I’m trying to use simple actionscript so that it will be helpful for new Flash users.

Click on First frame and Press F9 to show ActionScript panel, here write the following:

// Actionscript starts here:

// current date and time will be stored in stunning variable
stunning= new Date();
//this variable will be to get Day Name
// this varialbe will be to get Date
// this variable will be to get Month
// this varialbe will be to get Full Year i.e. 2010
// this variable will be to get Hours
// this variable will be to get Minutes
// this variable will be to get Seconds.

// if Date will be in single figure, then it will add 0 on its left
if (b<=9){
// if we show contents of variable a (which is used for Day Name) it will show day number, like 0 for Sunday, 1 for Monday and so on, but we want to show Day Name here so we are going to give Day Name to variable.
if (a==0){
if (a==1){
if (a==2){
if (a==3){
if (a==4){
if (a==5){
if (a==6){
// likewise if we show contents of varaible c (in which we called Name of Month) then it will also show numbers like 0 for January, 1 for February and so on, so here we are putting Names of month in variable.
if (c==0){
if (c==1){
if (c==2){
if (c==3){
if (c==4){
if (c==5){
if (c==6){
if (c==7){
if (c==8){
if (c==9){
if (c==10){
if (c==11){
// If Hour is in single figure then it will add 0 on its left
if (e<=9){
// If Minute is in single figure then it will add 0 on its left
if (f<=9){
// If Second is in single figure then it will add 0 on its left
if (g<=9){
// We are going to show these variables in Text boxes

fulldate=c+” “+b+”, “+d;
fulltime=e+” : “+f+” : “+g;

//Actionscript Ends here

7. Here you will get Final Digital Clock and Date.

You can also visit Smooth Analog Clock to make Analog Clock in Flash.

A professional Web/Graphic Designer, working as Freelancer since 2000. Designing is my passion, blogging is my hobby.


  1. Pingback: 20 Flash Preloaders with Source FLA
  2. Error code 1093,Syntax Error
    and the error code found at these lines

    Or give me your email,so i can attach the pic..thanks before

    1. File made in Adobe Flash CS4, so that is why it is having unexpected file format error while opening. As for as code are concerned it should not be having any error. Try to use e=”0″ add e; instead of e=”0″+e; likewise. Or can you send us the Error you are getting while clicking on “Check mark” button?

  3. I’m following each step here, but it doesn’t work…i was paste the script at my file and i push the check mark button and appear many error messages, i try to paste the fla source and appear “unexpected file format”, please help me…

  4. Thank very much you Mate. You are a smart dude. I’ll do that during the week-end. Another question if you do not mind. What is the best way to learn actionscript ? As3 ?

  5. this is really nice and cool
    thanks 4 this tutorial
    do u know how to make battery indicator with % sign for mobiles in flash
    if yes plse mail me

  6. Hi, Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it. — Linus Torvalds

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.