[flexcoders] Error #1034: Type Coercion failed: cannot convert JSON Data

2009-03-03 Thread keishalexie
Hi Everyone,

I am fairly new to Flex and am doing a project using Flex 3, the
as3corelib, and a PHP file that is sending json data.  The json data
is not being displayed in my data table and what is coming through is
valid (I checked in the JSON Validator).  I really am not sure where
the problem is: the mxml, php, as3corelib, or what?  Any suggestions
and I will post code if need be.



Re: [flexcoders] Error #1034: Type Coercion failed: cannot convert JSON Data

2009-03-03 Thread Anggie Bratadinata
Have you decoded the JSON data ?

Here's a snippet from a project I'm working on:

public function resultHandler(e:ResultEvent):void{
var rawString:String = String(e.result);
var json:* = JSON.decode(rawString);
var players:Array = json as Array;
_model.leaders = new ArrayCollection(players);
}

I use the AC as a dataProvider for some list component.

hth,
-- 
Anggie Bratadinata | www.masputih.com | Indonesia

On Tue, Mar 3, 2009 at 7:58 PM, keishalexie keishale...@yahoo.com wrote:

 Hi Everyone,

 I am fairly new to Flex and am doing a project using Flex 3, the
 as3corelib, and a PHP file that is sending json data.  The json data
 is not being displayed in my data table and what is coming through is
 valid (I checked in the JSON Validator).  I really am not sure where
 the problem is: the mxml, php, as3corelib, or what?  Any suggestions
 and I will post code if need be.