"Flash Script Learning"  Flashプログラムの研究・ソース配布・Flashゲーム

デジタル時計のスクリプト

Top - Flash Plus - Flash Script Learning - デジタル時計のスクリプト


内容

デジタル時計のスクリプト

スクリプト

now = new Date();
year = now.getFullYear();
month = now.getMonth() + 1;
day = now.getDate();
hour = now.getHours();
minute = now.getMinutes();
second = now.getSeconds();

//表示
_root.digital.years = year;
_root.digital.months = month;
_root.digital.days = day;
_root.digital.seconds = second;
if (_root.digital.seconds < 10) {
_root.digital.seconds = "0" + second;
}
_root.digital.minutes = minute;
if (_root.digital.minutes < 10) {
_root.digital.minutes = "0" + minute;
}
_root.digital.hours = hour;
if (_root.digital.hours < 10) {
_root.digital.hours = "0" + hour;
}

対象バージョン

Flash 5以降

メニューへ戻る



Studio Chuma Works 2003-2005