U-X > var

 

var

Availability

Flash Player 5.

Usage

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

Parameters

variableName An identifier.

value The value assigned to the variable.

Returns

Nothing.

Description

Action; used to declare local variables. If you declare local variables inside a function, the variables are defined for the function and expire at the end of the function call. If variables are not declared inside a block ({}), but the action list was executed with a call action, the variables are local and expire at the end of the current list. If variables are not declared inside a block and the current action list was not executed with the call action, the variables are not local.

Example

The following examples use the var action to declare and assign variables:

var x;
var y = 1;
var z = 3, w = 4;
var s, t, u = z;