Hi,
I have timer class and some classes use timer.
but when i come back from timer with callback function, i can see this. properties.
function Timer(dName, dCallback){
this.timer = null;
this.name = dName;
this.isRunning = false;
this.interval = 50;
this.callback = dCallback;
}
Timer.prototype.Start = function()
{
this.timer = self.setTimeout(this.callback,this.interval);
this.isRunning = true;
}
var timer;
function File(path)
{
....
if (timer == null)
timer = new Timer("load",File.prototype.WaitForUnFinishedFiles);
....
}
File.prototype.WaitForUnFinishedFiles = function()
{
var isAllFinished = true;
for(eFile in cache)
{
if(!cache[eFile].isReady)
{
isAllFinished = false;
break;
}
}
debugtext("load :::" + this.fileName);
if(!isAllFinished)
timer.Start();
}
and i call it in main.js
file = new File("http://bytes.com/images/simon_00.png");
file.WaitForUnFinishedF();
i used debugtext just for testing something but it says undefined. and its important for me to see this. properties after coming back from timer.
thanks