[osflash] clearInterval quandry

Jim Tann Jim at avtgroup.com
Thu Nov 3 12:15:08 EST 2005


When you use the setInterval function it looses the reference to the
object it is in so pass in the object as an argument.

 

class com.package.etc.SomeClass {

public var _timer:Number;

...

_timer = setInterval(someFunction, 1, this );

...

public function someFunction(objParent):Void
{
clearInterval(objParent ._timer ) 
trace( "inSomeFunction" );
}

 

I think you get the idea, I've not used setInterval that much and this
isn't exactly the most elegant solution but I think it is what you are
looking for.

________________________________

From: osflash-bounces at osflash.org [mailto:osflash-bounces at osflash.org]
On Behalf Of Jim Kremens
Sent: 03 November 2005 16:31
To: Open Source Flash Mailing List
Subject: Re: [osflash] clearInterval quandry

 

This makes it all go away:

 

http://www.kennybunch.com/index.php?p=16

 

Just make sure your interval is declared as a var in your class...

 

Jim Kremens

 

On 11/3/05, Richard Willis <richard.willis at digitalbrain.com> wrote: 

gals, guys

praps not quite the right place for this kind of enquiry but i'm having
some issues with clearInterval. it really is quite exasperating! 

this:

http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=
288&threadid=1075680&highlight_key=y&keyword1=clearInterval 

anyone got any idea init?

r.

_______________________________________________
osflash mailing list
osflash at osflash.org
http://osflash.org/mailman/listinfo/osflash_osflash.org

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/osflash_osflash.org/attachments/20051103/c13d4f61/attachment.htm


More information about the osflash mailing list