Flash a zegarek
: śr lut 22, 2006 11:43 am
Witam
jak zrobic we flashu zegarek ? chodzi mi o zegarek w danej animacji...
Kod: Zaznacz cały
this.createTextField("my_txt", 0, 10, 10, 200, 20);
//
function clock() {
var myDate = new Date();
var years = myDate.getFullYear();
var month = myDate.getMonth() + 1;
var day = myDate.getDate();
var hours = myDate.getHours();
var minutes = myDate.getMinutes();
var seconds = myDate.getSeconds();
month = month < 9 ? "0" + month : month;
day = day < 9 ? "0" + day : day;
hours = hours < 9 ? "0" + hours : hours;
minutes = minutes < 9 ? "0" + minutes : minutes;
seconds = seconds < 9 ? "0" + seconds : seconds;
return hours + ":" + minutes + ":" + seconds + " - " + day + "." + month + "." + years;
}
var IntervalID = setInterval(function () {
my_txt.text = clock();
}, 500);
Kod: Zaznacz cały
this.createTextField("my_txt", 0, 10, 10, 200, 100);
with (my_txt) {
html = true;
multiline = true;
wordWrap = true;
selectable = false;
}
//
function clock() {
var myDate = new Date();
var years = myDate.getFullYear();
var month = myDate.getMonth() + 1;
var day = myDate.getDate();
var hours = myDate.getHours();
var minutes = myDate.getMinutes();
var seconds = myDate.getSeconds();
month = month < 9 ? "0" + month : month;
day = day < 9 ? "0" + day : day;
hours = hours < 9 ? "0" + hours : hours;
minutes = minutes < 9 ? "0" + minutes : minutes;
seconds = seconds < 9 ? "0" + seconds : seconds;
czas = "<p><font face='tahoma' size='14' color='#666666'><br>" + hours + ":" + minutes + ":" + seconds + "</font></p>";
czas += "<p><font face='tahoma' size='11' color='#666666'>" + day + "." + month + "." + years + "</font></p>";
return czas;
}
var IntervalID = setInterval(function () {
my_txt.htmlText = clock();
}, 500);