jump to navigation

Digital clock in Flash September 21, 2010

Posted by Tournas Dimitrios in Flash.

This simple code creates a digital clock


function updateDate(e:Event):void{
	var date = new Date();

	if (date.hours< 10){
		hours_t.text = "0" + date.hours;
	else {
		hours_t.text = date.hours;

	if (date.minutes< 10){
		minutes_t.text = "0" + date.minutes;
	else {
		minutes_t.text = date.minutes;

	if (date.seconds< 10){
		seconds_t.text = "0" + date.seconds;
	else {
		seconds_t.text = date.seconds;

Need some help to create the clock ? download the code

Step 1

  • Create a new >Flash Project
  • Click on the plus icon New flash file > “Flash file” > Change the name of project <Untitled File>.fla
  • Select the Selection Tool V
  • Go to Properties tab and press Edit button and set the width of your document to 300 pixels and the height to 100 pixels.
  • Select #CCCCC color as background .
  • Change the layer name to digital( double click on it ).
  • Take the Text Toll (T) and draq 3 dynamic text, first for the hours (with instance name hours_t)  second for the minutes ( with instance name minutes_t) and third for the seconds(with instance name seconds_t)
  • Set the size of dynamic text to 50.0 pt, and any color.
  • Add glow filter to the text:



No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s