There is no difference between setInterval() and setTimeout() in this aspect. The function invoked by any of them has no object context ("this" is undefined inside the function), so use Delegate to set the scope.
Attila eed> I have a simple class and I can't access a private var after using eed> setTimeout... I typed this up to show whats happening: eed> eed> class foo extends MovieClip eed> { eed> private var nTime:Number = 0.75; eed> private var delay:Number; eed> eed> function foo() eed> { eed> // stuff eed> }; eed> eed> public function doSomething():Void eed> { eed> trace( nTime ); // works fine [0.75] eed> var delay = _global.setTimeout( delayedFunc, 1000 ); eed> }; eed> eed> private function delayedFunc():Void eed> { eed> trace( nTime ); //undefined ? eed> }; eed> } eed> eed> ?? I could use setInterval and kill it after the first fire, but setTimeout eed> is nicer. This is AS2 obviously. _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com