How to setTimeout("this.doSomething()",10)?
I have a custom object and in one of the methods of this object, I need to setTimeout to the method it's currently executing. Basically, so far, I've got:
But it doesn't work! The reason for this I believe is that when it is time for the timer to activate, it's no longer in the object, and therefore "this" doesn't exist anymore. When executing, I'm told that "this.move is not a function".
The only way I can think of solving this is to record all of the instances into an array and use a global function to target the correct instance, but I would prefer to get this to work...