Is your data in event.result?

Tracy

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of keishalexie
Sent: Tuesday, March 03, 2009 5:29 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Error #1034: Type Coercion failed: cannot convert
JSON Data

 

Here's where it is trying to decode from the project I have

private function getPHPData(event:ResultEvent):void
{
var rawArray:Array;
var rawData:String = String(event.result);
rawArray = JSON.decode(rawData) as Array;
dataArray = new ArrayCollection(rawArray);
}

It's like it is just blocked and the information that is in the tables
from mysql cannot get processed into my flex data tables properly.

--- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com,
Anggie Bratadinata
<anggie.bratadin...@...> wrote:
>
> 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...@...> 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.
> >
> >
>



Reply via email to