On 4/22/07, Shannon <[EMAIL PROTECTED]> wrote:
> Thank you for the response,
> > Boolean cannot be null. The default value is false if not
> initialised.
>
> So you're saying that AS3 sets a Boolean to false even without
> assignment?

Every type of variable has a default value. Boolean is false, int is
0, and so on. You can find the default values in the AS3 language
spec.

Also, I think it's good practice to always assign a value for the
benefit of those who come after you to maintain the code :)

> So in your reply:
> > I think you want to use int with predefined constants.
>
> Could you elaborate? Im not sure what you mean...

I meant to use an enum:

  TOGGLE: -1
  OFF: 0
  ON: 1

Then the developer can pass these constants instead of "magic values".

Reply via email to