Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE FLASH: Adobe Flash ForumAdobe Flash TutorialsAdobe Flash Video TutorialsWeb Streaming ForumAdobe Flash

digital clock with different time zones

Cow Forums : Adobe Flash
digital clock with different time zones
by Jacob Resendez (jacobean) 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);


Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINEDVDsBOOKSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]