I am trying to create a variable that will show the string value of an Array object deliminated with a comma. In short, I have created an ArrayCollection from FeatureSet.Attributes, modified it as in the code below (from Dan yesterday), and then applied a 'for each' statement to create the string values. All well and good, but the values that are returned are not delimited (I need a comma separating the values so that I can use it as a variable in a script). I created an Array composed of the string output (myString in code), and I applied the conventional methods to return comma separated values (params.toString(); and then params.join(","), but the results are the same: I get the values of the Array strung together without a delimiter. function onRbeResult(featureSet:FeatureSet, token:Object = null):void
{
try
{
for each (var gra:Graphic in featureSet.features)
{
var obj:Object = gra.attributes;
obj["gid"] = gid;
gid +=1;
}
gridDataProvider = featureSet.attributes;
LLdata.dataProvider = gridDataProvider;
var recAC:ArrayCollection = createRbeRecordData(featureSet,rbeID);
wRepeater.dataProvider = recAC;
var stopAC:ArrayCollection = new ArrayCollection;
var newObj:Object;
var j:int=0;
for(j=0;j<featureSet.attributes.length; j++)
{
newObj = featureSet.attributes;
delete newObj.NAME;
delete newObj.POLICY;
stopAC.addItem(newObj);
}
for each( var obj:Object in stopAC )
{
for each( var obj2:Object in obj )
{
myString += String( obj2 );
}
}
trace(myString);
var params:Array = new Array(myString);
// var paramsCSV:String = params.toString();//didn't work
var paramsCSV:String = params.join(",");//didn't work either
Alert.show(paramsCSV);
trace(paramsCSV);
The result of the trace is always as follows (the results change dynamically, but no change in format): null0642473168584021869369384069146424735691143668584076662168642473What I am looking for is e.g.642473,685840,1869369,etc.Perhaps the null value is creating a problem, or the code is wrong. Any help or pointers will be greatly appreciated, as always.Jim Faron