If I am understanding correctly (untested)
var oItem:Object;
for ( var i:int=0;i< theColleagues.length;i++) {
oItem = new Object();
oItem.contactId = theColleagues[i].contacID;
oItem. contactName = theColleagues[i].contactName;
for ( var j:int=0;j< theItems.length;j++) {
oItem[theItems[j]] = false;
}
myArrayCollection.addItem(oItem)
}
I'm not sure what you mena by "be the same length as the columns
contactID"
Tracy
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of michrx7
Sent: Monday, November 27, 2006 9:28 AM
To: [email protected]
Subject: [flexcoders] Someone please help me build this array
collection...
I need to build an array collection with a dynamic # of columns so
that I can use it as a dataProvider in a datagrid.
I am trying to combine the following:
1) Columns 1 & 2 need to be a copy of an arraycollection
called "theColleagues" with two columns that are returned by a
remoteoject call to a CFC.
a) contactID - a list of ID#s
b) contactName - a list of Names
2) I have an array with the names of items available on the form
let's say it is called "theItems". I need columns 3 - n to use the
header name found for each column in "theItems", but I need the
values in the column all set to boolean false and to be the same
length as the columns contactID and contactName found in step 2.
If I am able to do this I will be able to finish my project and get
back in the good graces of everyone involved.
Thanks,
-Mike