Created
April 22, 2009 00:46
-
-
Save bendalton/99504 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example usage | |
// var myResultCollection:ArrayCollection = parseResult(event.result.serverInfo); | |
public function parseResult(result:Object):ArrayCollection | |
{ | |
var collection:ArrayCollection = new ArrayCollection(); | |
for each(var resultArray:Array in result.initialData) | |
{ | |
var resultObject:Object = new Object(); | |
for(var i:Number = 0; i<result.columnNames;i++) | |
{ | |
resultObject[result.initialData[i]] = resultArray[i]; | |
} | |
collection.push(resultObject); | |
} | |
return collection; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment