[Flash]Digital Time

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.

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:

nakg0d

New Member
Messages
70
Reaction score
0
Points
0
I've been looking around for an already-compiled countdown timer in flash for a long time now... it'll actually come in good use with one of my ajax-powered scripts, since I haven't thought of an alternative (purely-javascript) way to countdown time based on XMLHTTPRequests... *blabbers*

If I ever need to reference for a timer, this would be it. Thanks..
 
Top