Ok so I have a multi array setup that I am trying to use to dynamically populate a listbox with multiple columns. So it's setup like this:
1) I have a function that creates a listbox gui and populates each column based on a multi array that is passed through an argument. The array contents are like this...
myAry = new Array([content1, content2, content3, content4], [subContent1, subContent2, subContent3, subContent4], [subContent1, subContent2, subContent3, subContent4]);
2) The function then grabs the main array length to determine to how many columns are needed (which works fine).
3) The function then loops through each sub array to populate the listbox content, but here's my issue, I need to assign the first array content a variable so I can then add subItems to that variable. Below is the section of code I'm referring to. Once the variable "column" is assigned it will no longer be valid upon returning through the loop. It mearly places all the array items into column one.
Idealy what I want is for the loop to run through myAry and when it hits the end of myArray[0] it then hops over to new code and runs myAry[1] as subItems and myAry[2] as subItems so on for however long myAry is. Make sense? lol, I'm losing my mind at the moment with a solution, if there even is one. Thanks for any help.
for(var a=0; a<contentCollectionLength; a++){//Loop through main array (per column content)
curAry = contentCollection[a];
curAryLength = curAry.length;
if(a == 0){
for(i=0; i<curAryLength; i++){//Loop through each sub array content
column = resultWin.listBoxGUI.add('item', curAry[i]);//Creates the first column of items
}
}
else if(a > 0){
column.subItems[0].text = curAry[i];//Suppose to create each successive column of items, but "column" becomes invalid
}
}