This discussion group will teach you how to create an Analog Clock in Flash
Steps to Follow
1. Open a new flash document. Create a clock like below using flash tools.
2. Now draw an clock second hand using line tool in new layer and convert into movieclip (F8). Name the movieclip as sec.
3. Like that create hour and minute hand and convert into movieclip then name it as hrs and mins respectively.
4. Now place the second, minute, hour hands at the center pivot point of the clock as like below.
5. Totally we have 4 layers. Create 5th layer for actionscript. Select 5th layer first frame and press F9 and type the below code:
_root.onEnterFrame = function ()
{
a = new Date();
setProperty(“sec”, _rotation, a.getSeconds() * 6);
setProperty(“mins”, _rotation, a.getMinutes() * 6);
setProperty(“hrs”, _rotation, a.getHours() * 30 + a.getMinutes() / 2);
};
Note: This clock run according to the system time.
Click here to download the source Analog Clock
Leave a Reply