Posted on Saturday 9 April 2005
Now that the most of the docs and the source code is laid down for AMFPHP 1.0, it’s a good time to think about sample files and example applications. The official 1.0 release should contain a folder with ready-to-use services and sample apps that one can play with. Now I wouldn’t want to reinvent the wheel and there are already some good tutorials that have the right kind of material for this purpose.
First, I would like to have about 10 or so very simple service files focusing on a single aspect of AMFPHP that will be distributed with the project, in particular:
- HelloWorld.php - obviously
- EchoData.php - echoes back values sent from Flash file
- SecureService.php - secured by roles and _authenticate
- Resultset.php - sends back an SQL resultset to Flash (must include an associated SQL file)
- AliasedService.php - as in previous distributions
- ClassMapping.php - shows how to map classes given as arguments to custom PHP classes
- UsingNetDebug.php - shows usage of NetDebug::trace()
- UsingDateWrapper.php - shows how to use the new DateWrapper class
- A couple of others as necessary.
If you have a couple of minutes to contribute such a file, I’ve made a section just for this purpose at the wiki. In addition to these single-purpose files, I would like to have three or four projects available. These should include Flash and actionscript files. Among them:
- EchoData - Press a button to send and receive data to/back from PHP. Similar to what was in the previous distributions, or what’s available at FlashXPress.
- PizzaService - As seen on the AMFPHP frontpage
- WebServices - Shows use of web services through AMFPHP, for example, Google search, MXNA, Amazon, Ebay, etc.
- Possibly another project, involving FlashComm or something else.
I would like these projects to follow these guidelines:
- Flash files should use v2 components
- Flash should use the v2 Remoting framework, ie: Service and not NetServices.as
- Flash files should limit the use of external actionscript files to one per project so newbies won’t be scared
- Actionscript should be well-commented
- If possible, one of the projects should use the data components and data binding (probably the web services one)
- PHP service should be well-commented
- PHP service should be fool-proof and not have any glaring security issues. In particular, any data written through SQL should be escaped using addslashes.
If you would like to contribute to any of these projects, then send me an email at $patrick->5etdemi(com) so we can coordinate our efforts.


