Flash Tutorial Analog Clock Actionscript 3.0 CS5.5 CS4 CS3 Round Wall Clock Animation


Script Source: http://www.developphp.com/video/Flash/Analog-Wall-Clock-or-Wrist-Watch-ActionScript-Tutorial
Learn how to create a Flash Analog Wall type clock with Adam Khoury of http://www.developphp.com. We animate it using a timer object, date object, and accessing the methods of the date object to adjust our mathematics that will change the rotation properties of the clock hands. Adam is using Flash CS5.5 and Actionscript 3.0 to assemble this application.


36 thoughts on “Flash Tutorial Analog Clock Actionscript 3.0 CS5.5 CS4 CS3 Round Wall Clock Animation”

  1. Mr.Adam please help me , although my problem small but it makes me crazy , i need to learn how to cut an image from a background and import it and it only to flash cs6 without any background however it was white black or even decorated because every time i tried to do this and cut it then save on desktop it comes with with white background again : and in flash same thing when i import it please help and give link about framework design as i thin you talked about. ( tyvm )

  2. I managed to get my first clock working but then I got a big problem! After everything was fine I tried to alter the design of the hands by deleting them and pasting in new ones from Illustrator. I made sure to name them exactly the same as the previous ones and even renewed the instances. However, the action script has stopped working and flags up syntax errors that were completely problem free 2 minutes before. What have I missed?

  3. Great turorial!
    Maybe an important note to highlight is that when doing any programing UPPERCASE and lowercase really matters throughout. I missed an uppercase T and spent a stupid amount of time sourcing the problem!

  4. var now:Date;
    var ct:Timer = new Timer(1000);
    ct.addEventListener(TimerEvent.TIMER, onTick);
    function onTick(event:TimerEvent):void{
    now = new Date();
    var s:uint = now.getSeconds();
    var m:uint = now.getMinutes();
    var h:uint = now.getHours();
    second_hand_mc.rotation = 180 + (s * 6);
    minute_hand_mc.rotation = 180 + (m * 6);
    hour_hand_mc.rotation = 180 + (h * 30) + (m * 0.5);

  5. hey adam
    can you help me. I want to change the hand rotation. I mean that the hands tick not every second but every milisecond or more faster. Can you send me the code for this.
    Thank you Dominik

  6. Hi Adam,

    Brilliant video – I've tried it and it works just fine.

    I'm doing an animation showing three clocks; one is ticking along at the normal speed (as shown in your video tutorial), and the others are spinning away really quickly.

    Can you explain how to have the second and third clocks ticking really quickly…? Would be highly appreciated!

    Thanks, Dan

  7. Adam,

    Thank you for another excellent tutorial. Leaving your error in the vid was beneficial since it helps me learn how to debug. Could you please do a tutorial on how to do a UTC clock (Universal Coordinated Time ) so I could keep up with that time on my web page.

    Thank you,


  8. i have some problem … 🙁
    i found error when i compile it ..
    TypeError: Error #1006: value is not a function.
    at Untitled_fla::MainTimeline/onTick()
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()

    help me plzz 🙁

  9. hey Adam , This is Mohit .you might know me through my tutorials..had a doubt myself ..whats the difference between getSeconds() method , seconds property and setSeconds method , esp the first 2 , i think getSeconds is read only and seconds property can be used to set the seconds . whats your takee on this?? btw awesome tut !!

Leave a Reply

Your email address will not be published. Required fields are marked *