Macromedia Flash - Digital clock
Time is money and we must always know how to hold it. This article will show you how to create a digital clock effect with the current date using Flash 8.
Step 1
Create a new Flash file with size of 250 x 70px
Step 2
Use the Text Tool (T), in the Properties Panel ( Ctrl + F3 ) set the Static Text and enter the Time text, under Time enter Date . See the picture below!
Step 3
Then select the Text Tool (T), in the Properties Panel (Ctrl + F3) set the Dynamic Text , use the drag and drop method to draw 2 rectangles to describe the time and date as shown below.
Step 4
Select the two rectangles you just drawn and press F8 on the keyboard to convert it into a Movie Clip as shown below
Step 5
Double-click the newly created Movie Clip (rectangle) or right-click the image and select Edit in Place .
Step 6
Select the rectangle corresponding to Time , open the Properties Panel (Ctrl + F3), in the Var section enter the time .
Step 7
Select the rectangle corresponding to Date , in the Properties Panel in Var enter date
Step 8
Go back to the main scene (Scene1) select the rectangles that have moved the Movie Clip, open the Action Script Panel (F9) and include the following 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 ();
}
And the last thing is to check our products. Is it too easy? You can download the source file here if you don't have time to do it yet.
You should read it
- How to change time, date and month in Windows 10?
- How to change date and time manually in macOS
- Date & Time in PHP
- Why must I set the correct date and time for Smart TV?
- time.h in C
- How to Set the Time and Date on a Partner Phone System
- Current date and time in Python
- Quickly insert current date and time into a cell in Excel
May be interested
- Macromedia Flash - Product image advertising effectsin this article, we will show you how to create a product advertising effect in flash. you can use this effect when you need to introduce a new product launch or in banner ads. this effect does not need to use any action script code but only created with mask in flash.
- Macromedia Flash - Create menu effectsthis lesson will show you how to create a flash menu with the effect when moving the mouse. to create this post, you will have to use the action script code.
- Macromedia Flash - Vivid photo effectsthrough this tutorial, you will learn how to create a vivid photo effect with some basic flash tips. this article does not need to use action script code.
- Macromedia Flash - Create flash menu with soundin this flash tutorial, we will guide you to create a dynamic flash menu with sound. you can use this menu on any website.
- Macromedia Flash - Self-designed animated menuthis tutorial is quite complicated but we will try to explain it in the easiest way. make sure you follow the instructions step by step.
- Macromedia Flash - Text presentation in Flashin this article, we will learn how to create a text presentation in flash using some special flash tips.
- Macromedia Flash - Effects of changing position of textthis tutorial will show you how to create a constantly changing text effect in flash using the action script.
- Macromedia Flash - Create a snow effectthrough this tutorial, you will create a snow effect simply and quickly. you can use this effect on headers, banners on holidays or christmas cards ...
- Macromedia Flash - Running text effectwith just a few simple steps you can completely create a seemingly complicated effect. you can apply this lesson as a text effect for some advertising banners or slideshows.
- Macromedia Flash - Create premium banners with flashwith this article, you will learn how to create fuzzy flash banners by using masks without using action script code.