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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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:

 

 

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

 

Jim Kremens

 

On 11/3/05, Richard Willis <[EMAIL PROTECTED]> 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
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

 

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to