First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Marcos J Pinto | Website: http://

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: 7.93 Votes: 119
(10 being the highest)
» 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.
» Forums
More help? Search our boards for quick answers!

Comments

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

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.