Copy link to clipboard
Copied
ow do I request the next number in an array?
For example - currently being used for a loop:
for (i=0; i = levelSettings[0]; i++)
But when the function (named - NextLevel() ) is called I would like that loop to call the next number in that array.
Example:
(i=0; i = levelSettings[1]; i++) //Not the change in the levelSettings
I would like this to work for all subsequent numbers in that particular array - so it can continue through to levelSettings[10] and so on.
Cheers!
Copy link to clipboard
Copied
use:
for(var k:Number=0;k<levelSettings.length;k++){
for(var i:Number=0;i<levelSettings
.
.
}
}
p.s. please mark correct responses.
Copy link to clipboard
Copied
I will attempt to apply to use this in my code in just a minute.
Could you explain to me how the code works?
Copy link to clipboard
Copied
in the outter for-loop, k is varying from 0 to the last index in levelSettings.
in the inner for-loop i varies from 0 to levelSettings
ie,
0 to levelSettings[0]
0 to levelSettings[1]
.
.
.
0 to levelSettings[last_index]
Find more inspiration, events, and resources on the new Adobe Community
Explore Now