Re: [Flashcoders] clearInterval(0);

2007-03-06 Thread Andy Herrman

I would suggest initializing the interval value as NULL instead of 0,
since I think 0 is a valid ID.  That way you can be sure you don't
accidentally clear an interval that you don't want to.

  -Andy

On 3/4/07, Alain Rousseau [EMAIL PROTECTED] wrote:

Well actually, clearInterval(0) clears the interval ID 0

lets say you have an interval defined :

var myInt:Number = setInterval(this, doSomething, 1000);

then it is possible that myInt = 0.

The value of myInt is set by calling setInterval, which returns the ID
of the interval,
so doing clearInterval(0) is the same as doing clearInterval(myInt)

but otherwise it doesn't do anything if no interval ID 0 exists

Adam Pasztory wrote:
 Wow, lots of interval questions lately... :)

 I don't believe clearInterval(0) does anything.  However, the code you
 posted looks correct.

 -Adam
 ___
 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


___
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


Re: [Flashcoders] clearInterval(0);

2007-03-06 Thread Muzak
or:

var num:Number = Number.NaN;
trace(isNaN(num));

regards,
Muzak

- Original Message - 
From: Andy Herrman [EMAIL PROTECTED]
To: flashcoders@chattyfig.figleaf.com
Sent: Tuesday, March 06, 2007 6:37 PM
Subject: Re: [Flashcoders] clearInterval(0);


I would suggest initializing the interval value as NULL instead of 0,
 since I think 0 is a valid ID.  That way you can be sure you don't
 accidentally clear an interval that you don't want to.

   -Andy



___
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] clearInterval(0);

2007-03-04 Thread Alexander Farber

Hello,

is it maybe safe to call clearInterval(0)
(same way as calling free(NULL) in C language)
or should I better not rely on this?

Here is my web chat function and I wonder
if I could get rid of the very first line in it:

var intervalID:Number = 0;
var resp_lv:LoadVars = new LoadVars();
var req_lv:LoadVars = new LoadVars();

function fetch(event_num:Number, args:String):Void {
if (0 != intervalID) /* XXX remove this check? */
clearInterval(intervalID);

req_lv.event = event_num;

if (args != undefined)
req_lv.args = args;
else
delete req_lv.args;

req_lv.sendAndLoad(MODULE_URL, resp_lv, 'GET');

intervalID = setInterval(fetch, 10 * 1000, ALIVE);
}

Regards
Alex

--
http://preferans.de
___
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


Re: [Flashcoders] clearInterval(0);

2007-03-04 Thread Adam Pasztory

Wow, lots of interval questions lately... :)

I don't believe clearInterval(0) does anything.  However, the code you
posted looks correct.

-Adam
___
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


Re: [Flashcoders] clearInterval(0);

2007-03-04 Thread Alain Rousseau

Well actually, clearInterval(0) clears the interval ID 0

lets say you have an interval defined :

var myInt:Number = setInterval(this, doSomething, 1000);

then it is possible that myInt = 0.

The value of myInt is set by calling setInterval, which returns the ID 
of the interval,

so doing clearInterval(0) is the same as doing clearInterval(myInt)

but otherwise it doesn't do anything if no interval ID 0 exists

Adam Pasztory wrote:

Wow, lots of interval questions lately... :)

I don't believe clearInterval(0) does anything.  However, the code you
posted looks correct.

-Adam
___
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