I'm trying to convert an arbitrary object into a Number, and then detect if the conversion actually succeeded. In theory I would convert it and then check if the converted value is NaN, but this doesn't seem to work.
Here's my test. In a blank FLA I put the following code: ---------- var foo = "foobar"; var fooN:Number = Number(foo); trace(typeof(fooN)); if(fooN == NaN) { trace("fooN is NaN"); } else { trace("fooN is a number: " + fooN); } ---------- This should output: number fooN is NaN but instead I get: number fooN is a number: NaN For some reason the check to see if it's NaN isn't working, and I have no idea why. It looks like I can use isNaN(fooN) for the check instead, but I'm wondering why == doesn't work. -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