Dear kyle and Veldhor, Thanx alot for your valueable responses..i got my error. It was in my php code.
thnx again regards, gyanprakash pandey --- On Wed, 8/10/08, valdhor <[EMAIL PROTECTED]> wrote: From: valdhor <[EMAIL PROTECTED]> Subject: [flexcoders] Re: Action script 3 JSON To: [email protected] Date: Wednesday, 8 October, 2008, 10:08 PM It appears from the original post that the error is Unexpected g encountered In your code you have echo "gyanprakash" if $_GET['getOrder' ] is set. So, is $_GET['getOrder' ] set? if so, you will get the error as the response will be gyanprakash (NOT JSON encoded). --- In [EMAIL PROTECTED] ups.com, "Kyle" <[EMAIL PROTECTED] > wrote: > > Is the php script that is returning the json data live somewhere on > the web? Can you give me a url that I could ping that will return the > json data? > > Thanks, > > Kyle > > > > > > > > --- In [EMAIL PROTECTED] ups.com, GYANPRAKASH PANDEY > <gyanprakash_ 108@> wrote: > > > > 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":"Gyanprak ash 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 <ktyacke@> wrote: > > From: Kyle <ktyacke@> > > Subject: [flexcoders] Re: Action script 3 JSON > > To: [EMAIL PROTECTED] ups.com > > 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" <haykelbj@ .> > > > > 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_ 108@> 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/ > > > Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/

