Macromedia Flash - Create analog clock in Flash
This tutorial will show you how to create a real working clock using Flash effects.
1. Create a clock to your liking. You can draw it in Photoshop and import it into flash or paint directly on the flash. You can get the following clock:
2. Create 5 layers on the Timeline section, their names respectively: sec (seconds), min (minutes), hour (hour) and actions . You can see the image below as a Timeline template.
3. Insert the background clock design that you have created
4. Draw a vertical line in the sec layer. Select the line and press F8 to convert it to Symbol. Name this Symbol sec_mc , select Movie clip and select the bottom middle box in the Registration section.
5. Click OK
6. In the sec layer, place sec_mc in the position corresponding to the clock background image you have designed. Name the layer sec in the Instance section of the Properties properties window to ' sec '.
7. Drag sec_mc from the Library window to layer min . If the Library window does not open, press Ctrl + L. Reduce the length of sec_mc in this section (to correspond to the minute hand). Place it in the position corresponding to the clock background image. Name this layer ' min ' in the Instance section of the properties window.
8. Continue dragging sec_mc to the layer hour from the opened Library window. Reduce the length of the needle again to correspond to the hour hand. Put it in place relative to the clock background image. Name it ' hour ' in the Instance box.
9. Select layer actions , go to Action Script ( F9 ) and enter the following code:
time = new Date (); // time object
seconds = time.getSeconds ()
minutes = time.getMinutes ()
hours = time.getHours ()hours = hours + (minutes / 60);
seconds = seconds * 6; // calculation seconds
minutes = minutes * 6; // calculated minutes
hours = hours * 30; // calculation hourssec._rotation = seconds; // giving rotation property
min._rotation = minutes; // giving rotation property
hour._rotation = hours; // giving rotation property
10. Go to the second frame of each layer and press F5 key.
If your clock does not work, try pressing Ctrl + Enter . In addition, you can make your own needles so that they don't necessarily have to take needles from sec_mc.
Download the source file here .
You should read it
- Macromedia Flash - Effects of lighting on photos
- Macromedia Flash - An attractive photo appearance effect
- Macromedia Flash - Falling text effect
- Macromedia Flash - Photo effects with sound
- Macromedia Flash - Complete Flash banner design
- Macromedia Flash: Create effects for nature photos
- Macromedia Flash - Animation and rotation effects
- Macromedia Flash - Effect of 'oil spill'
May be interested
- Macromedia Flash - Create photo album using mask techniquein this tutorial, we will show you how to create a stylish photo album display using a mask technique in the flash program. you will not have to use any action script fragment in this tutorial. this article can be applied to create photo albums, website banners, advertising galleries ...
- Edit batch files more quickly with ImageMagickcurrently, google has changed some of the policies in picasa service when allowing users to upload and store completely free for photos smaller than 800 pixels. therefore, we will definitely have to resize the image to make the most of picasa ...
- Macromedia Flash - Effects of changing position of textthis tutorial will show you how to create a constantly changing text effect in flash using the action script.
- Macromedia Flash - Complete Flash banner designin this article, we will show you how to create a complete flash banner without using the action script.
- Some eye-catching tips for using Adobe Photoshopas a beginner, familiarize yourself with graphic processing with adobe photoshop, eye exercises are one of the most basic parts. in the following article, we will show you the most necessary steps to complete this initial process ...
- Macromedia Flash: Create effects for nature photosthis tutorial will show you how to create simple effects for nature images using some special flash tips. this tutorial is implemented on flash cs5, there may be some differences if you use another flash version.