[FlashCodersNY] default parameter :Number

Rich Shupe lists at fmaonline.com
Thu Jun 4 09:02:29 PDT 2009


I would like to use null as null (for removing something from memory, for
example) and not let it be assumed to be "meaningless" (couldn't think of a
better word) as in this case.

I do use null as an argument for event listener functions, but that's not
relevant because the params don't have user-defined default values.

Maybe I'm just used to AS3 and I don't know that it's a sub-optimal way to
do it.

Related: I think your "equivalent (e.g., NaN)" choice was because this was a
Number data type, which is an important thing here. Different data types
have different default values in AS3. I found that tedious at first. (Not
being able to use undefined in every case, for example.)



On 6/4/2009 11:33 AM, "Hudson Ansley" <hudsonansley at gmail.com> wrote:

> it would be very simple, if null or equivalent (e.g., NaN) is passed,
> use the default.

Rich
http://www.LearningActionScript3.com





More information about the FlashCodersNY mailing list