|
Right-click the first frame on this new layer and go to Actions. Paste the code below and hit Ctrl+Enter to see your digital watch in action. stop();
var days = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
watch.onEnterFrame = function() { var date = new Date(); this.date = days[date.getDay()]+", "+date.getDate()+" of "+months[date.getMonth()]+" of "+date.getFullYear();
this.hour = date.getHours(); this.minute = date.getMinutes(); this.second = date.getSeconds(); if (this.second<10) { this.second = "0"+this.second; } if (this.minute<10) { this.minute = "0"+this.minute; } if (this.hour<10) { this.hour = "0"+this.hour; } };
|