Incrementing through instances of movieclips to get them into an array

I have a form with a bunch of questions.  With each question, the user needs to select an answer from a dropdown list.  I am then creating  an array that will store the answer to each question when the user clicks the submit button.  Each of the drop down menus is named sequentially.  So what I am trying to do is write  a while loop that will increment through and read each of the values into the array so I can process the responses later.  The issue that I am having is writing the syntax to recognize the Instance name of the specific drop down I am trying to reference.
Here is the basic code I am using:
var Store:Array = new Array(2);
public var Increment:Number;
Increment = 1;
while (Increment <=2){
Store[Increment] = MovieClip(Scroller2.Form_Scroller.content).DropDown1.value;
trace(Store);
Increment++;
So the DropDowns instance names are DropDown1, DropDown2 etc…  It works fine if I manually enter in each instance name (but there are 43 total and I don’t want to do each one individually).  
I am assuming that I need to setup some sort of variable to temporarily add the increment number to the “DropDown” and then use that as the reference:
Increment = 1;
while (Increment <=2){
                ItemNumber = "DropDown" + Increment;
                Store[Increment] = MovieClip(Scroller2.Form_Scroller.content).ItemNumber.value;
trace(Store);
Increment++;
But when I do that, I get the following error message:
TypeError: Error #1010: A term is undefined and has no properties.
                at combotest/submitted()
I assume this is because it is looking for an instance of ItemNumber instead of the instance of the value of ItemNumber.  So how do I get it to look for that?
I have attached the test files.
Steve

try:
var Store:Array = new Array(2);
public var Increment:Number;
Increment = 1;
while (Increment <=2){
Store[Increment] = MovieClip(Scroller2.Form_Scroller.content)["DropDown"+Increment].value;
trace(Store);
Increment++;

Similar Messages

Maybe you are looking for