Building the Clock
Before diving into the scripting tha does the real work, you have to build the Movie Clips of the clock's moving parts, that is, the Movie Clip that will contain the drawing of the clock (let's call it Clock) and the three Movie Clips that will contain the drawing of the clock's hands (let's call them Hr, Min and Sec). The movie clips for the clock's hands should have 60 frames each. For the minutes and seconds hands this is pretty obvious, that is, one frame for each position of the hands. The hours hand must have sixty frames too, as its position will also vary depending on the minutes hand.
The movie clips for the clock's hands should have 60 frames each. For the minutes and seconds hands this is pretty obvious, that is, one frame for each position of the hands. The hours hand must have sixty frames too, as its position will also vary depending on the minutes hand.
The Movie Clips for the Hands
The Movie Clips that will contain the hands of the clock will have a very simple structure - just one layer with sixty keyframes, each containing one of the sixty possible positions of the hand.
Now, this is important - so that the clock shows the right time, keyframe number 1 should have the hand pointing to the position of the number twelve (noon), keyframe number two should have the hand pointing to the position of the first minute, and so on, ultil keyframe number sixty, that should point to the position of the 59th minute. The hour pointer should follow exactly the same pattern.

Figure 1: Keyframe 1 must have the hand pointing to the number 12
And also don't forget to insert a Stop action in the first frame of each movie clip, as you don't want your clock's hands to move continuously.
| » Level Intermediate |
|
Added: 2000-11-22 Rating: 8.02 Votes: 115 |
| » Author |
| Marcos J Pinto is a free lance developer and a computer books author in Brazil. His most recent book is a begginers introduction to using Flash 5 (in Portuguese). |
| » Download |
| Download the files used in this tutorial. |
| Download (27 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!