[flexcoders] Re: Array to Grid

2007-04-04 Thread jmfillman
The resolution:

function splitString():void{
 var rtaString:String = myRTA.text;
 var pattern:RegExp = /\b[A-Za-z0-9'-]+\b/gi;
 var result:Array = new Array();
 var temp:Array;
 temp = pattern.exec(rtaString);
while (temp != null) {
 result.push({position:temp.index, word:temp});
 trace (temp.index, temp);
 temp = pattern.exec(rtaString);  
}
 myDGrid.dataProvider = result; 
}




[flexcoders] Re: Array to Grid

2007-04-03 Thread jmfillman
Okay, I've switched it to this:

public function toWords():void{
var str:String = myRTA.text;
var pattern:RegExp = /\b[A-Za-z0-9'-]+\b/gi;
var result:Array = new Array();
result = pattern.exec(str);
result.word = result;
result.position = result.index;
while (result != null) {
result.word = result;
result.position = result.index;
trace (result.index, result);
result = pattern.exec(str);
}
myDGrid.dataProvider = result;
}

How do I get the results to a DataGrid? When I do 
this: "myDGrid.dataProvider = result;" the result Array has a null 
value.