• Home
  • Free Tutorials
  • Free Video Tutorials

Adobe Photoshop
Autodesk 3ds Max
CSS
Flash
Help Center Live
iPhone
Joomla
Make Money Online!
Mambo
mIRC
Outlook Express
SEO / SEM
Simple Machine Forum
Target Explorer

Actionscript Analog Clock

Category : Flash Views : 18746
Version : 8 Rating : 
3.3/5 (45 votes)
  • Currently 3.33/5
  • 1
  • 2
  • 3
  • 4
  • 5
Type : Text Source File: actionscript-analog-clock.zip
Result: See the result


Previous | 1 | 2 | Next

Very simple design, but the clock is exactly synced with the system time.
Free Flash Tutorials, Actionscript, Analog Clock

The first thing to do is the hand Movie Clips, you need to make three of them: "HandHour", "HandMinute" and "HandSecond".
Free Flash Tutorials, Actionscript, Analog Clock

They need to be different in size, color and thickness. And the registration point should be located as in the image above.

Create another Movie Clip named "Clock", inside draw a clock without the hands; then start placing the hands: seconds, minutes, hours.

And give them the instance names: "sec", "min", "hours".

Select the hands Movie Clips, click on the Filters tab and add a "Drop Shadow" filter with these settings:
Free Flash Tutorials, Actionscript, Analog Clock

Now on the first frame of this Movie Clip paste:
this.onEnterFrame = function() { //new Date object; with day and time var date = new Date(); //get hour with the date object var hours = date.getHours(); //get minutes var minutes = date.getMinutes(); //get seconds var seconds = date.getSeconds(); //360 degrees divided by 60 minutes equal the degrees for each minute. //Multiply the degrees by minute with our "minutes" //variable to get the angle. min._rotation = 360 / 60 * minutes; //360 degrees divided by 12 hours times "hours" variable hour._rotation = 360 / 12 * hours; //360 degrees divided by 60 seconds times "seconds" variable sec._rotation = 360 / 60 * seconds; }


More cool tech articles from other blogs.

Place your ad here
Loading...


Previous | 1 | 2 | Next
How to Video Tutorials on software by Helpvids.com

Sponsors





Dallas Search Engine Positioning
Studio | Advertisement | About Webzo | Contact Webzo | Terms of Use | Free Video Tutorials by Helpivds

Copyright © 2007 NR Concepts Ltd. All rights reserved.