Flash ActionScript 3 For Loop Statement Tutorial
Looping statements are very powerful in all computer languages. It allows the program to perform some specific tasks repeatedly.
The for loop is the most commonly used loop statement in Flash ActionScript. It allows the program to iterate through a variable for a specific range of values. Three expressions are required in a for statement:
- a variable set to an initial value,
- a conditional determines when the looping ends, and
- an expression changes the value of the variable with each loop.
Structure of a For Loop Statement:
The For Loop Statement using in Flash ActionScript is explained in the following diagram:
The following is a typical and practical example of a for loop statement:
This Flash ActionScript tutorial provide an introduction of a For Loop statement.