SWiSH Player Support
SWF5 or later - Supported Internally
Syntax
for (initial ; condition ; end of loop) {
statements;
}
Arguments
statements: The statements that are to be executed while the condition is true.
initial: This clause can be used to set up initial conditions and Arguments. Multiple statements can be entered if each statement is separated by a comma.
condition: An expression that evaluates to a boolean value. The loop continues while this is true.
end of loop: A statement that is executed at the end of the loop. This is normally used to increment a loop counter. Multiple statements can be entered if each statement is separated by a comma.
Returns
Nothing.
Description
This Action executes and repeats while the condition remains true. If the condition is initially false, no statements are executed.
This is a more useful statement than while or do while if a loop is to be executed a defined number of times. It is ideal for initializing arrays.
Sample
for (i = 0; i <= 5 ; i++) {
trace(i);
}
// displays "0,1,2,3,4" in the 'Debug' window.
See Also
while, do...while and for.