package { import flash.display.Sprite; import flash.events.TimerEvent; import flash.utils.Timer; public class KClock extends Sprite { public var ticker:Timer; public function KClock() { this.drawFace(); this.drawHand(); this.update(); this.ticker = new Timer(1000); this.ticker.addEventListener(TimerEvent.TIMER, onTick); this.ticker.start(); } private function drawFace():void{ var face:Face = new Face(); face.x = 150; face.y = 150; face.name = "face"; this.addChild(face); } private function drawHand():void{ var sec:SecondHand = new SecondHand(); sec.x = 150; sec.y = 150; sec.name = "sec"; this.addChild(sec); var min:MinuteHand = new MinuteHand(); min.x = 150; min.y = 150; min.name = "min"; this.addChild(min); var hou:HourHand = new HourHand(); hou.x = 150; hou.y = 150; hou.name = "hou"; this.addChild(hou); var cen:Center = new Center(); cen.x = 150; cen.y = 150; cen.name = "cen"; this.addChild(cen); } public function onTick(evt:TimerEvent):void{ this.update(); } private function update():void{ var today:Date = new Date(); var len:uint = this.numChildren; for(var i:uint = 0;i