satheesh
New Member
- Messages
- 883
- Reaction score
- 0
- Points
- 0
Digital Time
1.Create a Text Field and Create set them instance name = “time”.
2.Select the first Frame.
3. Press F9 and Copy Code Below and paste it.
1.Create a Text Field and Create set them instance name = “time”.
2.Select the first Frame.
3. Press F9 and Copy Code Below and paste it.
Code:
_root.onEnterFrame = function() {
var time:Date = new Date();
hour = (time.getHours()<=12) ? time.getHours() : (time.getHours()-12);
hour = (hour<10) ? ["0"+hour] : hour;
second = time.getSeconds();
second = (second<10) ? ["0"+second] : second;
Minutes = time.getMinutes();
Minutes = (Minutes<10) ? ["0"+Minutes] : Minutes;
_root.time.text = [hour+"."+Minutes+"."+second];
};
Last edited: