[thelist] setInterval in class method

Jan Guichelaar [artmiks] jan at artmiks.nl
Thu May 26 02:26:13 CDT 2005


I found the solution
I lost scope when i called the setInterval function (this excists 
outside of the class, but is a global function)

i had to pass 'this' to the grow function,

growTimer = setInterval(grow, 500, this);

grow(objRef) {
    objRef.registerNode();
}

thanx
 all
jan

jan at artmiks.nl
 
Artmiks [image builders]
http://www.artmiks.nl  [now even in CHINESE]
====================
recent projects
http://www.kesselskramer.com  [update 2004 projects]
http://www.liptonicetea.nl  [create your own summer]
http://www.bronregisteraccountants.com  [the source]
====================



ben morrison wrote:

>>    * start growing this part
>>    */
>>    private function startGrow():Void {
>>        trace("start grow branch");
>>        grow(); // this reaches the registerNode method fine
>>        growTimer = setInterval(grow, 500); // this doesnt work
>>    }
>>    
>>
>
>It would help thelist if you explained that this was a flash problem.
>
>I havent used flash for a while but all I can suggest is that maybe
>growTimer needs to be declared as a function..
>
>ben
>  
>


More information about the thelist mailing list