Simple Digital Clock using flash

It is very simple to build a digital clock. All you need to do is follow the steps given below.

STEPS TO FOLLOW

Insert 3 layers in your time line window and name them, “background“, “text” and “actions“. Similar to the one shown below

  1. Select Frame1 of background layer, Design the framework for your digital clock.
  2. Select frame2 and press F5
  3. Now go to Frame1 of your text layer and insert Dynamic text field in your work area. Select frame2 and press F5To insert a Dynamic text field- Select text tool from your tool box,
    Select Dynamic text from Text pop-up menu in the Property inspector.
    Click on your work area wherever you want the digital clock to appear.
  4. Name this Dynamic text field instance as “clock_txt
  5. Go to frame1 of actions layer. Copy and paste the below mentioned script in the action.
  6. time=new Date(); // time object
    var seconds = time.getSeconds()
    var minutes = time.getMinutes()
    var hours = time.getHours()
    if (hours<12) {
    ampm = “AM”;
    }
    else{
    ampm = “PM”;
    }
    while(hours >12){
    hours = hours – 12;
    }
    if(hours<10)
    {
    hours = “0″ + hours;
    }
    if(minutes<10)
    {
    minutes = “0″ + minutes;
    }
    if(seconds<10)
    {
    seconds = “0″ + seconds;
    }
    clock_txt.text = hours + “:” + minutes + “:” + seconds +” “+ ampm;

  7. Now go to frame2 of actions layer and press F6 to insert a new keyframe.
    Still keeping the play head on the frame2, go to action panel and copy paste the below mentioned script.
  8. gotoAndPlay(1);

Download : Digital Clock (473)

Do not use flash in web pages

I am a person who hates to keep flash in a web page as it reduces the website loading speed drastically.Hence i am writting some of the resons for not including flash in your web pages.Please do have consideration on them and decide yourself.

  1. You can’t use the browser’s Find command to find a word on a Flash page.
  2. You can’t cut-and-paste text from a Flash page.
  3. You can’t use the browser’s “back” button to go back in a Flash file.
  4. To create a Flash website, you need to buy the $500 Flash application from Macromedia; to create an HTML website, you can do so with any free text editor.
  5. It tempts designers to prioritize using Flash over making an easy-to-use and useful website. In the hands of 95% of designers, Flash is used to create websites that would have been better made as HTML.