Hi Robert,

Gordon Smith from Macromedia posted this to another list a while ago. I am
reproducing it with his permission. Hopefully it will clarify things a bit:

Note, that this applies only to AS 3, not to AS 2

***************************************************************
 'undefined' is basically legacy baggage in AS3 that must remain for
ECMA-262 compatibility.

Type Object is the ONLY type that can store the value undefined. It can
also store the value null... it can store anything!

Some but not all other classes can store null:

A derived class like Button can store null but not undefined.

String and Array can store null but not undefined.

Number can store NaN but it can't store undefined or null.

int and uint can't store NaN, undefined, or null; they only store
integers like 23.

Boolean can't store undefined or null; it only stores true and false.

Since Object is the only type that can store undefined, if you try to
set a var of another type to undefined, it will be coerced into
something different. For example, setting a Number to undefined will
coerce it to NaN.

- Gordon
*********************************************************************

Spike


On 10/21/05, Robert Edgar <[EMAIL PROTECTED]> wrote:
>
> AFAIK null and undefined are the same thing in F7/8 and can be used
> interchangeably
> Conceptually however we tend to think of 'undefined' and 'defined but has
> a
> null value' as two different things.
>
> >From what I have read in the Flex2 documentation undefined and null are
> no
> longer the same thing and null means 'defined but has a null value'.
>
> Can someone confirm that is correct.
>
> Thanks
> Rob
>
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



--
--------------------------------------------
Stephen Milligan
Do you do the Badger?
http://www.yellowbadger.com

Do you cfeclipse? http://www.cfeclipse.org
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to