> 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
> always check for both. { (var != undefined && var != null) }
>
> Is there an explanation somewhere regarding the difference
> between undefined
> and null, and when to expect which? If not, can someone who understands
> explain it?
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. The best example of null in my opinion is the TextFormat object,
where values are set to null unless otherwise defined, and setTextFormat
leaves a property unchanged if the value is null.
But I have to admit it's a slightly tenuous distinction...
Danny
_______________________________________________
[email protected]
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