FORUMS: list search recent posts

digital clock with different time zones

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jacob Resendez
digital clock with different time zones
on Mar 5, 2008 at 3:50:11 pm

i have a flash clock that displays time based on the users computer. ive used this clock sucessfully in many websites. i now have a client who needs a clock to display the current time in different parts of the world. i was thinking of using the same clock, but modifying the code to scroll and display the different times. the clock is very basic and only has two keyframes. ive pasted my code below. if you have any suggestions, i would greatly appreciate it very much.

KEYFRAME 1:

time=new Date(); // time object
var seconds = time.getSeconds()
var minutes = time.getMinutes()
var hours = time.getHours()
if (hours<12) {
ampm = "AM";
}
else{
ampm = "PM";
}
while(hours >12){
hours = hours - 12
;
}
if(hours<10)
{
hours = ""+(hours+6);
}
if(minutes<10)
{
minutes = "0" + minutes;
}
if(seconds<10)
{
seconds = "0" + seconds;
}
clock_txt.text = hours + ":" + minutes + ":" + seconds +" "+ ampm;



KEYFRAME 2:

gotoAndPlay(1);


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]