# AMFPHP + as2 parse result

**URL:** https://forum.kirupa.com/t/amfphp-as2-parse-result/287694
**Category:** flash
**Created:** [May 5, 2009, 12:02pm UTC](https://forum.kirupa.com/t/amfphp-as2-parse-result/287694 "2009-05-05T12:02:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Lawrenc3](https://avatars.discourse-cdn.com/v4/letter/l/f1d935/32.png) [@Lawrenc3](https://forum.kirupa.com/u/Lawrenc3)
#### Post date: [May 5, 2009, 12:02pm UTC](https://forum.kirupa.com/t/amfphp-as2-parse-result/287694/1 "2009-05-05T12:02:27Z")

</div>

Hi,

I’d be trule thankful for anyone who tells me how this is done.  
I have some tutorials about this but i don’t know how to parse the resultEvent…  
this is what is in the tutorial:

_[SIZE=2]function onEchoData(msg:ResultEvent){  
mx.remoting.debug.NetDebug.trace({level:“Debug”, message:“onEchoData” });  
show.text = msg.result;  
}[/SIZE]_

AMFPHP returns a single string.

But i’m trying to parse something like this:

[SIZE=2]\*callProducts() returned {\_items: [  
{ID: 1, **ID** : 0, koodi: “0000001”, loc: “muro”, tuote: “tuote 1”},  
{ID: 2, **ID** : 1, koodi: “0000002”, loc: “muro”, tuote: “tuote 2”},  
{ID: 3, **ID** : 2, koodi: “0000003”, loc: “muro”, tuote: “tuote 3”},  
{ID: 4, **ID** : 3, koodi: “0000004”, loc: “muro”, tuote: “tuote 4”}],

\*[/SIZE]  
The AS3 version would be something like this:

[SIZE=2]_function onResult(responds:Object):void  
{  
var t:Array = responds.serverInfo.initialData;  
trace(t[0][2]);  
}_  
[/SIZE]  
But how do I write that with AS2 ?

Please help.
