I am having some trouble getting the JSON.decode() methodworking.I
currently have the following JSON file in UTF-8
format:{"states":[{"id":140,"state":"Alabama","obama":6,"mccain":5,"ec":3},{"id":91,"state":"Alaska","obama":4,"mccain":5,"ec":3}],"USA":{"obama":7450,
"mccain":7450}}I am accessing it in Flex with the following
code:private function onJSONLoad(event:ResultEvent):void{ var
rawData:String = String(event.result); var countries:Array =
(JSON.decode(rawData) as Array); Alert.show(countries.length as String);
var dp:ArrayCollection = new ArrayCollection(arr);
voteTable.dataProvider = dp;}]]>However, for the life of me, I cannot get Flex
to correctlyparse the JSON code into an array. In the line:var
countries:Array = (JSON.decode(rawData) as Array);The coun...