Dear Kyle,

I did not get the error. Here is my php code;
<?
class Order
{
    public $id;
    public $d_date;
    public $name;
    
}


if(isset($_GET['getOrder']))
{
    $p = new Order();
    $p->id= '1';
    $p->d_date= '02-03-2008';
    $p->name = 'Gyanprakash Pandey';
    
    echo "gyanprakash";
    echo ($p);
    echo "gyan";
}
else
{
    $p = new Order();
    $p->id= '1';
    $p->d_date= '02-03-2008';
    $p->name = 'Gyanprakash Pandey';
    
    
    echo json_encode($p);


?>

Out put of json encoded data is :
{"id":"1","d_date":"02-03-2008","name":"Gyanprakash Pandey"}

Action script function i used to decode is :

var rawData:String= event.result.toString();
                var orders:Object= (JSON.decode(rawData) as Object);
myText.text= orders.id + orders.d_date + orders.name;
                Alert.show("Data transmitted successfully");



Still i'm getting the same error.

Can you please find out the exact error!!!!! It'll be a great help.

thank you very much,

Regards,
Gyanprakash Pandey

--- On Tue, 7/10/08, Kyle <[EMAIL PROTECTED]> wrote:
From: Kyle <[EMAIL PROTECTED]>
Subject: [flexcoders] Re: Action script 3 JSON
To: [email protected]
Date: Tuesday, 7 October, 2008, 12:06 AM










    
            

If you can't find the error, post the json output that is causing the

error to be thrown (the json encoded data that is being returned from

your php script), as well as the AS3 code that you wrote to decode the

json data here and I can take a look at it for you. However, like

Haykel said, more often than not this type of error is caused by a

simple syntax error in your json return.



-Kyle



--- In [EMAIL PROTECTED] ups.com, "Haykel BEN JEMIA" <[EMAIL PROTECTED] .>

wrote:

>

> Seems that you have a syntax error in the JSON string. Inspect its

content

> before sending it to the JSON decoder.

> 

> On Sat, Oct 4, 2008 at 2:35 PM, GYANPRAKASH PANDEY <

> gyanprakash_ [EMAIL PROTECTED]> wrote:

> 

> >   Dear all,

> >

> > I'm using JSON and php for back end data transfer in flex. But,

i'm getting

> > following error:

> > Error: Unexpected g encountered

> >     at com.adobe.serializa tion.json: :JSONTokenizer/ parseError( )

> >     at com.adobe.serializa tion.json: :JSONTokenizer/ getNextToken( )

> >     at com.adobe.serializa tion.json: :JSONDecoder/ ::nextToken( )

> >     at com.adobe.serializa tion.json: :JSONDecoder$ iinit()

> >     at com.adobe.serializa tion.json: :JSON$/decode( )

> >     at adminPage/handlePla inJSON()

> >     at adminPage/__ pendingOrderRpc_ result()

> >     at

> >

flash.events: :EventDispatcher /flash.events: EventDispatcher: :dispatchEventFu 
nction()

> >     at flash.events: :EventDispatcher /dispatchEvent( )

> >     at mx.rpc.http. mxml::HTTPServic e/

> >

http://www.adobe. com/2006/ flex/mx/internal ::dispatchRpcEve 
nt()<http://www.adobe. com/2006/ flex/mx/internal ::dispatchRpcEve nt%28%29>

> >     at mx.rpc::AbstractInv oker/

> >

http://www.adobe. com/2006/ flex/mx/internal 
::resultHandler()<http://www.adobe. com/2006/ flex/mx/internal ::resultHandler% 
28%29>

> >     at mx.rpc::Responder/ result()

> >     at mx.rpc::AsyncReques t/acknowledge( )

> >     at ::DirectHTTPMessage Responder/ completeHandler( )

> >     at

> >

flash.events: :EventDispatcher /flash.events: EventDispatcher: :dispatchEventFu 
nction()

> >     at flash.events: :EventDispatcher /dispatchEvent( )

> >     at flash.net::URLLoade r/flash.net: URLLoader: :onComplete( )

> >

> >

> > Can u please help me out in this case..

> >

> > Thanx alot in advance..

> >

> > Regards,

> > Gyanprakash Pandey

> >

> >

> > ------------ --------- ---------

> > Unlimited freedom, unlimited storage. Get it

now<http://in.rd. yahoo.com/ tagline_mail_ 2/*http:/ /help.yahoo. com/l/in/ 
yahoo/mail/ yahoomail/ tools/tools- 08.html/>

> > 

> >

> 

> 

> 

> -- 

> Haykel Ben Jemia

> 

> Allmas

> Web & RIA Development

> http://www.allmas- tn.com

>




      

    
    
        
         
        
        








        


        
        


      Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/

Reply via email to