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 Text running in bannerdetails of this article will guide how to create text running on extremely attractive banner. you can use this text to create in ads, slideshows or websites to stand out. through this article, you will also learn a few tips for creating dynamic flash letters for use for other purposes.
- Macromedia Flash - Create banner text effectthis article will show you how to create a beautiful text effect through some special flash tips. you won't need to use action script but simply create effects based on available tools. this tutorial can be applied when creating banners, advertisements and slideshows ...
- Macromedia Flash - Create premium banners with flashwith this article, you will learn how to create fuzzy flash banners by using masks without using action script code.
- Macromedia Flash - Create a snow effectthrough this tutorial, you will create a snow effect simply and quickly. you can use this effect on headers, banners on holidays or christmas cards ...
- Macromedia Flash - Product image advertising effectsin this article, we will show you how to create a product advertising effect in flash. you can use this effect when you need to introduce a new product launch or in banner ads. this effect does not need to use any action script code but only created with mask in flash.
- Macromedia Flash - The spotlightjust a few simple steps in flash 8.0 you can create a nice effect: the spotlight effect.
- Macromedia Flash - Create current date and time notificationsin this lesson, you will learn how to create a file that announces the current date with flash. just use the given code to quickly create this file.
- Macromedia Flash - Vivid photo effectsthrough this tutorial, you will learn how to create a vivid photo effect with some basic flash tips. this article does not need to use action script code.
- 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 ...
- Macromedia Flash - Falling text effectthe words that just fall and rotate will be what you can do after reading this exercise ...