else

Availability

Flash Lite 1.0.

Usage

if (condition){
    t-statement(s);
} else {
    f-statement(s);
}

Parameters

condition An expression that evaluates to true or false.

t-statement(s) The instructions to execute if the condition evaluates to true.

f-statement(s) An alternative series of instructions to execute if the condition evaluates to false.

Description

Statement; specifies the statements to run if the condition in the if statement evaluates to false.

Example

The following example shows the use of the else statement with a condition. An actual example would include code to take some action based on the condition.

currentHighestDepth = 1;
 if (currentHighestDepth == 2) {
     //trace ("currentHighestDepth is 2");
 } else {
     //trace ("currentHightestDepth is not 2");    
 }

See also

if