I would like a text area that holds multiple strings to send its values to an array and the array to convert the string to an object. The objects then populate a datagrid. I can’t really figure out where to go from here:
var arrayString:String = myTextArea.text;
var newArray:Array = arrayString.split(",");
var n:int=newArray.length;
while (n--)
{
newArray[n]=Number(newArray[n])
var obj:Object = new Object();
obj.label = newArray[n];
this.myDataGrid.addItem(obj );
}
1 Answer