O'Reilly logo

Essential ActionScript 3.0 by Colin Moock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Default Variable Values

When a variable is declared without a type annotation and without an initial value, then its initial value is automatically set to the value undefined (the sole value of the datatype void). When a variable is declared with a type annotation but no initial value, then its initial value is automatically set to a default value for its specified datatype.

Table 8-6 lists the default values, by datatype, for variables in ActionScript.

Table 8-6. Default variable values

Datatype

Default value

String

null

Boolean

false

int

0

uint

0

Number

NaN

All other types

null

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required