Показать сообщение отдельно
Старый 26.08.2009, 15:02
Oli Short вне форума Посмотреть профиль Отправить личное сообщение для Oli Short Найти все сообщения от Oli Short
  № 3  
Ответить с цитированием
Oli Short

Регистрация: Aug 2009
Сообщений: 38
да, на 1.0 так как книжка по нему.
сама работа приложения вот http://www.flashblog.ru/?p=218#more-218

Добавлено через 39 минут
даже так
Код AS1/AS2:
function classTimer() {}
 
	classTimer.prototype.year = 2011;
	classTimer.prototype.month = 0;
	classTimer.prototype.day = 1;
	classTimer.prototype.hour = 15;
	classTimer.prototype.minute = 0;
	classTimer.prototype.second = 0;
 
classTimer.prototype.getMyTimer = function () {
	//2010,7,26,13,0,0
	year = this.year;
	month = this.month;
	day = this.day;
	//hour = this.hour;
	//minute = this.minute;
	//second = this.second;
 
	yourDate = new Date(year, month, day);
	yourDateMsec = yourDate.getTime();
	nowDate = new Date();
	nowDateMsec = nowDate.getTime();
	var msec = yourDateMsec-nowDateMsec;
	if (msec<=0) {
		time_txt.text = "It`s Time";
		//clearInterval(interval);
	} else {
		var sec = Math.floor(msec/1000);
		var min = Math.floor(sec/60);
		var hour = Math.floor(min/60);
		var day = Math.floor(hour/24);
		sec %= 60;
		min %= 60;
		hour %= 24;
		time_txt.text = "Days: "+day+", Hour: "+hour+", Min: "+min+", Sec: "+sec;
	}
}
 
mytimer1 = new classTimer();
 
setInterval(mytimer1.getMyTimer, 1000);
всегда почему то It`s Time, вроде все правильно задаю. если просто вывести mytimer1.getMyTimer(); то все хорошо выводит, только таймер стоит на месте