[Flashcoders] Getting a compiler error

2008-10-30 Thread Eric E. Dolecki
if( Number(loc[0]) == NaN || Number(loc[1] == NaN )return; Warning: 1098: Illogical comparison with NaN. This statement always evaluates to false. Okay, so I have also tried if( loc[0] == NaN || loc[1] == NaN ) return; I get the same error. loc[0] 99.9% of the time is a string value

Re: [Flashcoders] Getting a compiler error

2008-10-30 Thread Ian Thomas
Try the isNaN() method: if (isNaN(Number(loc[0]))) however, shouldn't you be using parseInt() or parseFloat() instead of Number()? Casting a String as a Number is a risky thing to do at the best of times! So try: if ((isNaN(parseInt(loc[0]))||(isNaN(parseInt(loc[1]))) return; HTH, Ian

Re: [Flashcoders] Getting a compiler error

2008-10-30 Thread Juan Pablo Califano
Use isNaN instead. For some reason I don't really get, this evaluates to false in AS 3.0. trace( (NaN == NaN) ); Cheers Juan Pablo Califano 2008/10/30, Eric E. Dolecki [EMAIL PROTECTED]: if( Number(loc[0]) == NaN || Number(loc[1] == NaN )return; Warning: 1098: Illogical comparison with

Re: [Flashcoders] Getting a compiler error

2008-10-30 Thread Eric E. Dolecki
Thanks Juan ;) On Thu, Oct 30, 2008 at 10:42 AM, Juan Pablo Califano [EMAIL PROTECTED] wrote: Use isNaN instead. For some reason I don't really get, this evaluates to false in AS 3.0. trace( (NaN == NaN) ); Cheers Juan Pablo Califano 2008/10/30, Eric E. Dolecki [EMAIL PROTECTED]: