this.addEventListener(Event.ENTER_FRAME,showTime);
function showTime(e:Event):void {
var d:Date=new Date();
if (d.minutes < 10) lblTime.text = d.hours + ":0" + d.minutes;
else lblTime.text = d.hours + ":" + d.minutes;
}//showTime
Download the movie
You could also do this using a timer.
INDEX, Introduction to the Date Class, The Date, A Digital Clock, An Analog Clock (with hands)
Next lesson: Examples