mani
mani

Reputation: 51

For Loop Variables declaration

How to initialize and make condition for 2 variables in single for loop in Flex

let keep i and j are two variables

Upvotes: 2

Views: 279

Answers (2)

dragonkhan
dragonkhan

Reputation: 374

like this:

            for(var i:int=0,j:int=2;i<10 && j<20;i++,j+=2){
                trace(i);
                trace(j);
            }

Upvotes: 3

Maxime Pacary
Maxime Pacary

Reputation: 23001

You may try :

for (var i:uint = 0, j:uint = 0; i < something, j < something_else ; i++, j++) {
   //...
}

Upvotes: 2

Related Questions