Flash Lite 1.x ActionScript Language Reference |
|
|
|
| Flash Lite Statements > if | |||
Flash Lite 1.0.
if (condition) {statement(s); }
condition An expression that evaluates to true or false.
statement(s) The instructions to execute if the condition evaluates to true.
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.
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();
}
|
|
|
|