Perform more complex initializations and increments by adding additional expressions separated by commas
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
for(var i:Number = 0, a:Number = 25; i < 25; i++, a -= 2) {
trace(i + " " + a);
}
}
}
}
0 25
1 23
2 21
3 19
4 17
5 15
6 13
7 11
8 9
9 7
10 5
11 3
12 1
13 -1
14 -3
15 -5
16 -7
17 -9
18 -11
19 -13
20 -15
21 -17
22 -19
23 -21
24 -23
Related examples in the same category