PDA

View Full Version : Objects in Array...


Kenwio
07-27-2008, 02:18 PM
Hi!

I have:

//dataGrid is a DataGrid declared earlier
var cols:Array = dataGrid.columns;
trace(cols);


If I test/debug this I get:
[object DataGridColumn],[object DataGridColumn],[Obje...

But I want to access the 'dataField' property of each DataGridColumn in the array 'cols'.

How do I do that?

Kenwio
07-27-2008, 02:47 PM
sekasi on kirupaForum solved this:

var len:uint = cols.length;
for (var i:int = 0; i < len; i ++) {
trace(cols[i].dataField);
};

Thanks to him
//Kenwio