Okay, heres the flash client (only 47k!) for the TVguide webservice posted recently.
It’s quite a fairly simple movie using flash remoting and amfphp. I used amf to call my tvguide webservice via SOAP. Instead of having your swf call a specifc flash service, you call a special service which acts like a proxy to SOAP webservices. This service looks like this..
1 2 3 4 5 6 7 8 9 10
You connect to this via NetServices..
Then you specify the webservice you want by providing the endpoint to the getService method..
and then call the webservice method you want…
The paramsObj is a value object holding any parameters the webservice method expects. When the data comes back you handle it the normal way..
Oh, and I had lots of fun playing about with the datagrid and creating a custom cell for it for the channel logo graphics.
Based on the Model View Architecture which works basically like this for those of you who don’t know yet: The Model is an object that handles the remoting stuff and nothing else. It just connects to remote services and handles the data when it comes in. When the data does come in, it fires of an event to the View. The View is a listener of the Model so when the Model shouts, the View jumps. Now when the user interacts with the app, its the Controller that decides what to do; call a method on the Model or the View. Nice and easy…MVC ain’t completely perfect but its very useful…