This can be done several ways… here are two of the faster performance-wise ways for this:

var maxNum:int  = 5;
var inverse_i:int;
for(var i:int=maxNum; i => 0 ; i--) {
   inverse_i = maxNum - i;
   trace(inverse_i);
}
// or you can do this:
var inverse_i:int;
for(var i:int=5; i => 0 ; i--) {
   trace(inverse_i);
   inverse_i++;
}

Author: Jonathan Dunlap
Jonathan is a veteran software architect, author of IsoHill, humanitarian, and has worked with Bigpoint Inc, CrowdStar, ePrize, and Microsoft.

Tags: ,