if

Availability

Flash Lite 1.0.

Usage

if (condition) {
    statement(s);
}

Parameters

condition An expression that evaluates to true or false.

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

Description

Statement; evaluates a condition to determine the next action in a SWF file. If the condition is true, Flash Lite runs the statements that follow the condition inside curly braces ({}). If the condition is false, Flash Lite skips the statements inside the curly braces and runs the statements following the braces. Use the if statement to create branching logic in your scripts.

Example

In the following example, the condition inside the parentheses evaluates the variable name to see if it has the literal value "Erica". If it does, the play() function runs.

if(name eq "Erica"){
    play();
}