Basically i start with this when document is ready:
var newObj = new MyClass(variables);
newObj.start();
And MyClass looks like this (simplying it here)
var MyClass = function(){
this.start = function(){
this.loop();
}
this.loop = function(){
// do lots of stuff here
setTimeout(function(){this.loop();}, 1000);
}
} // end MyClass
During runtime it tells me that 'this.loop' is not a function at the line where setTimeout is called
What am i missing?
Thanks