Date: 06/18/07 (Javascript Community) Keywords: no keywords I am having some trouble getting the instance name of a class.
class = function()
{
this.instanceName = ???
this.x = 50;
this.start = function()
{
this.interval= window.setInterval(this.instanceName + '.moveIndicator()', this.x);
}
this.stop = function()
{
window.clearInterval(this.timer);
}
}
My issue is that short of passing in the instance name I dont know how to dynamically determine it. I am sure that this is possible. I could also be approaching this incorrectly. Essentially the issue is that when the methods are fired off clearInterval has no idea what "this" refers to. Source: http://community.livejournal.com/javascript/134412.html
|