Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

newbie help

5 views
Skip to first unread message

Alexis

unread,
Jul 21, 2009, 9:45:29 AM7/21/09
to ActionScript 3 Core Library
I'm using this library for the first time. The raw data I'm getting
back from PHP looks fine, but when I decode it, I seem to get a bunch
of empty objects.

Here is an excerpt of some of the JSON that is returned when I call
trace(urlLoader.data);

{"facets" : {"des_facet" : [{"count" : 1427 , "term" : "BOOKS AND
LITERATURE"} , {"count" : 1228 , "term" : "UNITED STATES POLITICS AND
GOVERNMENT"} , {"count" : 1199 , "term" : "SUBPRIME MORTGAGE
CRISIS"}]

Then I try to parse the JSON using:

var feed:Object = (JSON.decode(urlLoader.data));

Then when I do:
trace(feed.facets);
I get an object returned

BUT if I try to get something from that facets array using:

trace(feed.facets[0]);

I get "undefined".

Any help?

Anirudh Sasikumar

unread,
Jul 22, 2009, 2:41:02 AM7/22/09
to as3co...@googlegroups.com
Try feed.facets.des_facet[0]
Cheers,
--
Anirudh Sasikumar
http://anirudhs.chaosnet.org/
Reply all
Reply to author
Forward
0 new messages