Dunno if there's a good reason behind it, but if you need it to return null you can always use "delete intervalID" just afar clearing the interval.
Karina > -----Original Message----- > From: Helmut Granda [mailto:[EMAIL PROTECTED] > Sent: 24 April 2007 22:19 > To: Flashcoders mailing list > Subject: [Flashcoders] Clear Set Interval Q: > > Is there any specific reason why after calling clearInterval > the variable with the interval returns 1 instead of undefined/null? > > Following the docs and creating a simple item we get > different results (no different but no what our logic might expect) > > function callback() { > trace("interval called: "+getTimer()+" ms."); } > > var intervalID:Number = setInterval(callback, 1000); > trace(intervalID); > > clear_btn.onRelease = function(){ > clearInterval( intervalID ); > trace(intervalID);//shouldnt this return undefined/null? > trace("cleared interval"); > }; > > start_btn.onRelease = function() { > intervalID = setInterval(callback, 1000);// this adds 1 > to the current interval > trace(intervalID); > } > _______________________________________________ > 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 > _______________________________________________ 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