Use Number type variable in for loop : Number « Data Type « Flash / Flex / ActionScript






Use Number type variable in for loop

 
package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        for (var i:Number = 25; i > 0; i--){
          trace(i);
        } 
    }
  }
}
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1

        








Related examples in the same category

1.Read and write to a variable
2.Decimal Numbers
3.Casting to a Number: Number(stringValue)
4.Dealing with Infinite Values: Number.POSITIVE_INFINITY and Number.NEGATIVE_INFINITY
5.Handling Minimum and Maximum Values: MAX_VALUE and MIN_VALUE
6.Minimum and Maximum Values for uint and int
7.Working with Number Instances
8.The default value for an unassigned variable of type Number is NaN
9.Not a Number: use the top-level function isNaN()