Newest Articles

MegaCombs
Flash Media Player
XML Driven Pie Chart
Base Defender
Hangman Game
8 Ball Pool


Popular Articles

Hangman Game
Infinitely Zooming Image
FLV Player
True Fullscreen Flash Mode
Mp3 Player with XML Playlist
Create Pong


Random Articles

Drivable Car
12 Hour Clock with Hands
Image Color Tinting using Actionscript
Show the Current Frames Per Second
Gilbert
Photo Reel


Links

Shapes the Game
Reddit
Newgrounds
TWiT
Link to SwfSpot
Swf Spot

Contact me on Google+



rss feed

12 Hour Clock with Hands

12 Hour Clock with Hands
AddThis Social Bookmark Button
Description: An analog-style clock with hour, minute, and second hands
Author: John Bezanis
Added: February 6th 2007
Version: Flash 8


Here's a simple example of a clock with hands. It uses the windows time. This is all of the actionscript required to get the clock working:
  1. onClipEvent(enterFrame){
  2.   var time = new Date();
  3.   this.seconds._rotation=time.getSeconds()*6-90;
  4.   this.minutes._rotation=time.getMinutes()*6-90;
  5.   this.hours._rotation=(time.getHours()%12)*30-90;
  6. }

The source file is available below for download.
Download Source File
Comments Currently Disabled