Instance Name

    Date: 06/18/07 (Javascript Community)    Keywords: no keywords

    I am having some trouble getting the instance name of a class.

    I have a class (this is just an example)

    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

« fiddling with parameters in... || Question for the more skilled. »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home