무비클립에 붙어넣을 스크립트 소스
onFrame (1) {weekName = ["일", "월", "화", "수", "목", "금", "토 "];
var today = new Date();
var thisY = today.getFullYear() + "년 ";
var thisM = today.getMonth() + 1 + "월 ";
var thisD = today.getDate() + "일 ";
var thisW = weekName[today.getDay()] + "요일";
date.text = thisY + thisM + thisD + thisW;
}
function setDigit(getTime) {
var rtnTime;
if (getTime <10) {
rtnTime = "0"+getTime;
} else {
rtnTime = getTime;
}
return rtnTime;
}
onSelfEvent (enterFrame) {
cntTime = new Date();
thisHour = setDigit(cntTime.getHours());
thisMin = setDigit(cntTime.getMinutes());
thisSec = setDigit(cntTime.getSeconds());
time.text = thisHour + ":" + thisMin + ":" + thisSec;
}