This had to be one of the things I struggled on most when picking up flex however it is really really easy!

I’m using a PHP back end and all you need is a http service:

    <s:HTTPService id=”dataService”
    method=”POST”
    url=”{phpFile}”
    showBusyCursor=”true”
    result=”handleDataResult(event)”
    fault=”handleFault(event)”/>

And then just set up some data to send it:

    var params= {};
    params[action]=getData;
    dataService.send(params);

On the PHP side these are just received as post variables:

    action = $_POST[action];

Then the result (whatever you echo in PHP) is stored in:

    dataService.lastResult

See, easy :D

__*NOTE: I had huge problems when retrieving xml. It seems there are some problems when using flash builder and the network monitor. If you’re getting end of stream errors try running your application with the network monitor disabled. * __

This makes it so easy to produce a client server architecture using technologies which you are already familiar with. Flex does not just work with PHP it will also work with lots of other service types in a similar fashion.