var

Availability

Flash Player 5.

Usage

var variableName [= value1] [...,variableNameN [=valueN]]

Parameters

variableName An identifier.

value The value assigned to the variable.

Returns

Nothing.

Description

Statement; used to declare local or Timeline variables.

You cannot declare a variable scoped to another object as a local variable:

my_array.length = 25;     // ok
var my_array.length = 25; // syntax error

When you use var, you can strictly type the variable; see Strict data typing

Note: Classes defined in external scripts also support public, private, and static variable scopes. See Creating Classes with ActionScript 2.0 and private, public, and static.