# I need to do 1 for loop but two variables

**URL:** https://forum.kirupa.com/t/i-need-to-do-1-for-loop-but-two-variables/58804
**Category:** flash
**Created:** [July 26, 2004, 12:17pm UTC](https://forum.kirupa.com/t/i-need-to-do-1-for-loop-but-two-variables/58804 "2004-07-26T12:17:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![emorej](https://avatars.discourse-cdn.com/v4/letter/e/a4c791/32.png) [@emorej](https://forum.kirupa.com/u/emorej)
#### Post date: [July 26, 2004, 12:17pm UTC](https://forum.kirupa.com/t/i-need-to-do-1-for-loop-but-two-variables/58804/1 "2004-07-26T12:17:05Z")

</div>

[color=black][font=Arial]Can anyone help with this; I have tried several ways but does not work.[/font][/color]

[color=black][font=Arial]The first for loop creates the numbers to collect the correct tag in my xml file, but I need a second variable to select my Array numbers [0][1][2][3]…[/font][/color]

here is the code, the code in red is the script im trying to work out

MyArray = [4, 5, 6, 7, 8];  
function shuffleArray() {  
return Math.round(Math.random());  
}  
myArray.sort(shuffleArray);  
for (var i = 4; i \< 9; i++; [color=red]var e = 0; e \< 5; e++)[/color][color=black]{[/color]  
[color=red]spread = myArray[e];[/color]

questionClip.attachMovie(“RandomAnswer”, “containeranswer”+i, i);  
questionClip[“containeranswer”+i].\_y = 0+((i\*15)-34);  
questionClip[“containeranswer”+i].\_x = 95;  
questionClip[“containeranswer”+i].ranAnswer = questionsArray[currentQuestion].[color=red]answers[spread];[/color]  
}

}
