while()
Top  Previous  Next


SWiSH Player Support
SWF4 or later - Supported Internally

Syntax
while (condition) {
   statements;
}

Arguments
statements: The statements that are to be executed while the condition is true.
condition: An expression that evaluates to a boolean value.

Returns
Nothing.

Description
This Action executes and repeats while the condition remains true. If the condition is initially false, no statements are executed.

Sample
onLoad () {
    a = 1;
    while (a++ < 5) {
        trace(a);
    }

}


The above example writes the numbers 2 3 4 5 to the 'Debug' window.

See Also
do...while and for.