How to make a easy digital clock in flash

Download the source: digitalclock

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:

Step 2

  • Create a new layer and change the name to actionscript
  • Copy / Paste the following code:

stage.addEventListener(Event.ENTER_FRAME,update date);

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
}

}
, , ,

Subscribe

Subscribe to our e-mail newsletter to receive updates.

7 Responses to “How to make a easy digital clock in flash”

  1. GOLDEN MAN Says:

    thansk a lot

  2. Kratos Says:

    The code cannot be copied so here’s it …

    stage.addEventListener(Event.ENTER_FRAME,update date);

    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
    }

    }

Trackbacks/Pingbacks

  1. How to make a easy digital clock in flash | Flash tutorials … « action script - May 6, 2010

    [...] Zobacz resztę artykułu: How to make a easy digital clock in flash | Flash tutorials … [...]

  2. How to make a easy digital clock in flash | Flash tutorials … | Flash Designers - May 6, 2010

    [...] original post here:  How to make a easy digital clock in flash | Flash tutorials … Posted in flash tutorials Tags: change, download-the-source, flash, flash-file, flash-project, [...]

  3. I need to design a website for my brothers band. Can anyone recommend a great web builder site, something cool | BingSite - May 7, 2010

    [...] How to make a easy digital clock in flash | Flash tutorials | Flash video tutorials | Flash actionsc… [...]

  4. Help! Opening an online store and I need advice. What is the best cheap ecommerce web host? | BingSite - May 7, 2010

    [...] How to make a easy digital clock in flash | Flash tutorials | Flash video tutorials | Flash actionsc… [...]

  5. Tweets that mention How to make a easy digital clock in flash | Flash tutorials | Flash video tutorials | Flash actionscript | flash animation | flash menu | flashconf.com -- Topsy.com - May 7, 2010

    [...] This post was mentioned on Twitter by J. Anna. J. Anna said: Flash Tutorial: : How to make a easy digital clock in flash http://bit.ly/b7Z3Sw [...]

Leave a Reply