Perform more complex initializations and increments by adding additional expressions separated by commas : for « Statement « Flash / Flex / ActionScript

Flash / Flex / ActionScript
1. Animation
2. Array
3. Class
4. Data Type
5. Development
6. Function
7. Graphics
8. Language
9. Network
10. Regular Expressions
11. Statement
12. String
13. TextField
14. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Flash / Flex / ActionScript » Statement » for 
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
1. The for Statement
2. Use a for loop to check whether a string contains the @ character
3. Place two statements in the for statement
4. Nested for loops
5. Use for each loop to go through the array elements
6. Use for loop to loop through the dynamic array
7. Use for statements to loop backward:
8. Use for loop statement to display all elements in an array
9. Use For in loop to display all properties in an object
10. break is a keyword that allows you to stop processing a loop or conditional.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.