Цитата:
|
Сообщение от bleed
весь код скрипта покажи, у меня была такая ерунда, недавно создавал топик здесь. _etc подсказал что это вероятно из-за бесконечного цикла или рекурсивной функции.
вот ссылка на мой топик
http://flasher.ru/forum/showthread.php?t=91300
|
вот

Код:
System.useCodepage = true;
System.security.allowDomain("******.ru");
s = "";
hpp = 0;
hp1 = 0;
hp2 = 0;
old_sec = 0;
progressBar.gotoAndStop(100);
time_remain = "осталось: 0 мин.";
hp_tmp = hp1+" / "+hp2;
startt.onPress = function() {
var my_xml:XML = new XML();
var fname:String = "http://*****.*******.ru/inf.pl?login="+login+"&short=1";
my_xml.ignoreWhite = true;
my_xml.onData = function(str) {
trace(str)
my_arr = str.split("\n");
for (i=0; i<=my_arr.length-2; i++) {
s = my_arr[i];
my_arrr = s.split("=");
hppp = my_arrr[1].split("/");
hp1 = int(hppp[0]);
hp2 = int(hppp[1]);
hpp = int(hppp[0]);
}
progressBar.gotoAndStop(1);
_root.timer = setInterval(function () {
//расчёт здоровья
time = new Date();
sec = time.getSeconds();
hp_sec = hp2/1800;
if (hp1<hp2) {
if (old_sec != sec) {
hpp = hpp+hp_sec;
hp1 = int(hpp);
percent = int((hp1*100)/hp2);
progressBar.gotoAndStop(_root.percent);
time_remainn = (hp2-hp1)/hp_sec/60;
time_remain = "осталось: "+Math.round(time_remainn*10)/10+" мин.";
old_sec = sec;
}
} else {
time_remain = "осталось: 0 мин.";
old_sec = 0;
progressBar.gotoAndStop(100);
clearInterval(_root.timer);
}
hp_tmp = hp1+" / "+hp2;
}, 50);
updateAfterEvent();
};
my_xml.load(fname);
};