import flash.events.MouseEvent;
import flash.utils.Timer;
import flash.events.TimerEvent;
var beginButton:TimerStart=new TimerStart();
beginButton.x = 40;
beginButton.y = 148;
beginButton.width = 471;
beginButton.height = 100;
addChild(beginButton);
var clockFace:ClockFace = new ClockFace();
clockFace.x = 99;
clockFace.y = 23;
clockFace.width = 350;
clockFace.height = 350;
clockFace.visible = false;
addChild(clockFace);
var clockHand:ClockHand = new ClockHand();
clockHand.x = 275;
clockHand.y = 202;
clockHand.width = 32;
clockHand.height = 150;
clockHand.visible = false;
addChild(clockHand);
var timerEnd:TimerExpired = new TimerExpired();
timerEnd.x = 40;
timerEnd.y = 148;
timerEnd.width = 471;
timerEnd.height = 100;
timerEnd.visible = false;
addChild(timerEnd);
beginButton.addEventListener(MouseEvent.CLICK, startTimer);
var clockTimer:Timer = new Timer(1000,10);
clockTimer.addEventListener(TimerEvent.TIMER, tickTimer);
clockTimer.addEventListener(TimerEvent.TIMER_COMPLETE,timerExpired);
function startTimer(e:MouseEvent):void
{
beginButton.visible = false;
clockFace.visible = true;
clockHand.visible = true;
beginButton.removeEventListener(MouseEvent.CLICK, startTimer);
clockTimer.start();
}
function tickTimer(e:TimerEvent):void
{
clockHand.rotation += 36;
}
import flash.utils.Timer;
import flash.events.TimerEvent;
var beginButton:TimerStart=new TimerStart();
beginButton.x = 40;
beginButton.y = 148;
beginButton.width = 471;
beginButton.height = 100;
addChild(beginButton);
var clockFace:ClockFace = new ClockFace();
clockFace.x = 99;
clockFace.y = 23;
clockFace.width = 350;
clockFace.height = 350;
clockFace.visible = false;
addChild(clockFace);
var clockHand:ClockHand = new ClockHand();
clockHand.x = 275;
clockHand.y = 202;
clockHand.width = 32;
clockHand.height = 150;
clockHand.visible = false;
addChild(clockHand);
var timerEnd:TimerExpired = new TimerExpired();
timerEnd.x = 40;
timerEnd.y = 148;
timerEnd.width = 471;
timerEnd.height = 100;
timerEnd.visible = false;
addChild(timerEnd);
beginButton.addEventListener(MouseEvent.CLICK, startTimer);
var clockTimer:Timer = new Timer(1000,10);
clockTimer.addEventListener(TimerEvent.TIMER, tickTimer);
clockTimer.addEventListener(TimerEvent.TIMER_COMPLETE,timerExpired);
function startTimer(e:MouseEvent):void
{
beginButton.visible = false;
clockFace.visible = true;
clockHand.visible = true;
beginButton.removeEventListener(MouseEvent.CLICK, startTimer);
clockTimer.start();
}
function tickTimer(e:TimerEvent):void
{
clockHand.rotation += 36;
}