Read data in to arraycollection. [using httpservice result property]

First the httpservice looks like this.

<mx:HTTPService id=”productlist” url=”product_list.php” useProxy=”false” showBusyCursor=”true” result=”readProducts(event)”/>

The result property in the httpservice gets the data from PHP.

Now define the function for result:

import mx.collections.ArrayCollection;

[Bindable]
private var prods:ArrayCollection = new ArrayCollection();

private function readProducts(event:ResultEvent):void
{
prods=(event.result.product.items);
}

and my PHP page looks like this:

<product>

<items>

<name>pen</name>

</items>

</product>

Now the arr coll variable prods has the data from PHP.

Now u can give this prods as dataprovider for DataGrid.

Leave any comments for suggestions.

4 Responses to “Read data in to arraycollection. [using httpservice result property]”

  1. music Says:

    very interesting.
    i’m adding in RSS Reader

  2. kumargandhi Says:

    hi
    is it , then thanks.

    regards
    kumar gandhi

  3. Hiram Says:

    I only need to read an arraycollection, what do I do?

  4. kumargandhi Says:

    there is no concept of ArrayCollection in PHP and as far as i know in other technologies also , so we have to do type casting here and thats what iam doing here, i think iam correct , comment me if iam wrong.

    regards,
    kumar.

Leave a Reply