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.
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 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.
// 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 Hour is in single figure then it will add 0 on its left
// If Minute is in single figure then it will add 0 on its left
// If Second is in single figure then it will add 0 on its left
// 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.