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
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
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
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
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
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
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
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
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
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
: [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
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
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
: [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
.
}
}
--
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
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
16 matches
Mail list logo