[Flashcoders] Difference between null and undefined?

2006-07-19 Thread Rifled Cloaca
FlashCoders, I've recently been upgrading some old Flash MX code to Flash 8, and have been running into issues where properties return 'undefined' instead of 'null'. I seem to recall that undefined was introduced in Flash 7. I've always been confused about when something is undefined versus

RE: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread Danny Kodicek
I've recently been upgrading some old Flash MX code to Flash 8, and have been running into issues where properties return 'undefined' instead of 'null'. I seem to recall that undefined was introduced in Flash 7. I've always been confused about when something is undefined versus null, so I

Re: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread jcanistrum
I think null = explicity that the var points to nothing and undefined = never received any value or reference before Perhaps before Flash 7 all the vars with no assignments were set to null by default, I´m not sure 2006/7/19, Rifled Cloaca [EMAIL PROTECTED]: FlashCoders, I've

RE: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread Marijan Miličević
By my understanding, undefined refers to a variable that doesn't exist, whereas null is a variable that exists but has no value, or an undetermined value. not really, variable that exists, but is not explicitly assigned has value undefined: var foo; // undefined var bar = null;//null -m

Re: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread Nicolas Cannasse
By my understanding, undefined refers to a variable that doesn't exist, whereas null is a variable that exists but has no value, or an undetermined value. not really, variable that exists, but is not explicitly assigned has value undefined: var foo; // undefined var bar = null;//null

RE: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread Danny Kodicek
By my understanding, undefined refers to a variable that doesn't exist, whereas null is a variable that exists but has no value, or an undetermined value. not really, variable that exists, but is not explicitly assigned has value undefined: var foo; // undefined var bar = null;//null

RE: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread Mike
PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rifled Cloaca Sent: Wednesday, July 19, 2006 8:00 AM To: Flashcoders mailing list Subject: [Flashcoders] Difference between null and undefined? FlashCoders, I've recently been upgrading some old Flash MX code to Flash 8, and have been running

Re: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread Rifled Cloaca
This is particularly annoying: In files published for Flash Player 6 or earlier, the value of String(undefined) is (an empty string). In files published for Flash Player 7 or later, the value of String(undefined) is undefined (undefinedis converted to a string). Why convert 'undefined' to a

RE: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread Mike
It's useful in traces. -- T. Michael Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rifled Cloaca Sent: Wednesday, July 19, 2006 9:34 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Difference between null and undefined

Re: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread janosch
between null and undefined? FlashCoders, I've recently been upgrading some old Flash MX code to Flash 8, and have been running into issues where properties return 'undefined' instead of 'null'. I seem to recall that undefined was introduced in Flash 7. I've always been confused about when something

RE: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread Mike
: [Flashcoders] Difference between null and undefined? You can actually just use (!var) in most cases. if (!undefined) { // This will always run. trace(undefined); } if (!null) { // This will always run. trace(null); } if (!false) { // This will always run

RE: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread Mike
Subject: Re: [Flashcoders] Difference between null and undefined? little error in !foo, correct like this: if (!foo) { // This will never run. trace('foo'); } ___ Flashcoders@chattyfig.figleaf.com To change your subscription options

Re: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread janosch
Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of janosch Sent: Wednesday, July 19, 2006 9:39 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Difference between null and undefined? little error in !foo, correct like this: if (!foo

Re: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread Rifled Cloaca
: [Flashcoders] Difference between null and undefined? little error in !foo, correct like this: if (!foo) { // This will never run. trace('foo'); } ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http

RE: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread Mike
. } } -- T. Michael Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of janosch Sent: Wednesday, July 19, 2006 10:24 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Difference between null and undefined? Thats very strange, but in usual

Re: [Flashcoders] Difference between null and undefined?

2006-07-19 Thread ryanm
That is really weird, huh? Well, for strings, I think it's often better to use .length for Boolean tests, anyway: function test(s:String) { if (s.length) { // Catches any nonempty string. } else { // Catches null, undefined, and empty strings. } } Ok, this is why people have such a hard