First the HttpService looks like this:
<mx:HTTPService id=”productlist” url=”product_list.php” useProxy=”false” showBusyCursor=”true” result=”readProducts(event)”/>
Now define the handler on 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[product_list.php] page will output data like below:[just echo of each line]
<product>
<items>
<name>pen</name>
</items>
</product>
Now the AC variable prods has the data from PHP file[product_list.php].
Now u can give this prods as dataprovider to DataGrid.
Leave any comments for suggestions.
Note: The above post has been updated/corrected to improve readability.


January 8, 2008 at 9:55 pm |
very interesting.
i’m adding in RSS Reader
January 10, 2008 at 2:08 pm |
hi
is it , then thanks.
regards
kumar gandhi
June 25, 2008 at 7:04 pm |
I only need to read an arraycollection, what do I do?
June 30, 2008 at 11:02 am |
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.