Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>i'm decoding my json encoded data this way..</p> <p><code> $data = urldecode(utf8_decode(stripslashes($_REQUEST['data']))); $decoded_result = json_decode($data);</code></p> <p>btw: did you add the appropriate event handler to your URLLoader instance ?</p> <p>[update] here is an example that works for me..</p> <pre><code>//loader event handler function ioHandler (evt:IOErrorEvent): void { trace("IOError: "+ evt.text ); } function httpHandler (evt:HTTPStatusEvent): void { trace("HTTPStatus: "+ evt.status ); } function completeHandler (evt:Event): void { trace(complete" ); } var person:Object = new Object(); person.fullname = "jon jay junior"; person.username = "jjj"; person.role = "ADMIN"; var people:Array = new Array(); people.push(person); var vars: URLVariables = new URLVariables(); vars.data = JSON.encode(people); var request:URLRequest = new URLRequest(); request.url = "http://localhost/data.php"; request.data = vars; var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.VARIABLES; loader.addEventListener(Event.COMPLETE, completeHandler); loader.addEventListener(IOErrorEvent.IO_ERROR, ioHandler); loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpHandler); loader.load(request); </code></pre> <p>and for the serverside, this script</p> <pre><code>//the server side &lt;?php $data = urldecode(utf8_decode(stripslashes($_REQUEST['data']))); $decoded_result = json_decode($data); print_r($decoded_result); ?&gt; </code></pre> <p>which produces the following the "response" view in firebug </p> <pre><code>Array ( [0] =&gt; stdClass Object ( [username] =&gt; jjj [fullname] =&gt; jon jay junior [role] =&gt; ADMIN ) ) </code></pre> <p>hope this helps.. kindest</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload