onEnterFrame = function () { // happens every frame var date:Date = new Date(); // grabs the time and date settings from your computer hours = date.getHours(); //sets an hour variable minutes = date.getMinutes(); //sets an minute variable seconds = date.getSeconds(); //sets an second variable if (seconds<10) { seconds = "0"+seconds; } if (minutes<10) { minutes = "0"+minutes; /* if seconds or minutes is less than ten, stick a zero in front of them*/ } if (hours>12) { hours -= 12; /* tests every frame if the hour is greater than 12. If it is the code subtracts 12 from the hour (sets it to 1) */ } _root.disp = hours+":"+minutes+":"+seconds; };