Flash Actionscript: Digital Clock
Posted by kkool | Filed under Flash Actionscript & Design

Flash Actionscript: Digital Clock
เป็นการอ่านค่าเวลาจากเครื่อง Client ขำๆครับ เอาไปใช้แต่งเว็บกัน หรือจะเขียน CD ก็เจ๋ง
Script เวลา
var date=new Date();
time=new Date(); // time object
var seconds = time.getSeconds();
var minutes = time.getMinutes();
var hours = time.getHours();
var dayweek = date.getDay();
var dayweek_str:String;
if (days<10){
days_str=”0″+days;
}
else{
days_str=days;
}
if (hours<12) {
ampm = “AM”;
}
else{
ampm = “PM”;
}
if(hours>12){
hours = hours - 12;
}
if(hours == 00){
hours = 12;
}
if(hours<10){
hours = “0″ + hours;
}
if(minutes<10){
minutes = “0″ + minutes;
}
if(seconds<10)
{
seconds = “0″ + seconds;
}
switch (dayweek){
case(0):dayweek_str=”SUN”; break;
case(1):dayweek_str=”MON”; break;
case(2):dayweek_str=”TUE”; break;
case(3):dayweek_str=”WED”; break;
case(4):dayweek_str=”THU”; break;
case(5):dayweek_str=”FRI”; break;
case(6):dayweek_str=”SAT”; break;
}
clock_txt.text = hours + “:” + minutes + “:” + seconds;
ampm_txt.text = ampm;
clock_back_txt.text = “88:88:88″;
date_txt.text=dayweek_str;
Download FLA: Flash Digital Clock
Please enable Javascript and Flash to view this Flash video.
Tags: flash actionscript, flash digital clock
One Response to “Flash Actionscript: Digital Clock”
-
Flash Actionscript: Digital Clock | BLOG [in] TREND : เว็บบล็อกดี ๆ ที่ อินเทรนด์ Says:
March 11th, 2009 at 10:52 am[...] Download FLA: Flash Digital Clock Click here to view the embedded video. [...]




