numbers in sequence


var test:int;

for (var rows:uint=0; rows <10; rows++)

{

          for (var cols:uint= 0; cols <2; cols++)

          {

                    trace(test);

                    test++;

          }

}

 

this traces numbers 0 19. trace 0 9 , 0 9 again. , if increase toe rows in first for-loop let's 100, trace 0 9, 0 9, 0 9 etc. on , on again.

 

how can make happen? can't use third for-loop since want use on arrays. let's i've got array 20 entries array[0] array [19]. then, when find index of 14, should turn 4. , index of 19 should equal 9. can't subtract 10 since want make work other way around. index of 4 should stay 4 , not turn -14. whatever number use, if it's index of 259, should equal it's correct location between 0 , 9.

 

some kind of math way should use think. how?

use:

 

 

 

var test:int;

for (var rows:uint=0; rows <10; rows++)

{

          (var cols:uint= 0; cols <2; cols++)

          {

                   trace(test%9);

                    test++;

          }

}

 



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account