Read data in to ArrayCollection from PHP backend.[using HttpService]

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;

private var prods:ArrayCollection = new ArrayCollection();

private function readProducts(event:ResultEvent):void

and my PHP[product_list.php] page will output data like below:[just echo of each line]






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.


7 Responses to Read data in to ArrayCollection from PHP backend.[using HttpService]

  1. music says:

    very interesting.
    i’m adding in RSS Reader

  2. kumargandhi says:

    is it , then thanks.

    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.


  5. GR Yannacoulias says:

    THank you sir. very helpful little write up.

  6. tell_me_please says:

    I want to keep data with some variable and sort some data

    to display the table.(grid cannot sort or change data)

    how i can do?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: