AMFPHP Now Supports Adobe Flex
The AMFPHP project, headed by Patrick Mineault, has added support for AMF3, the newest AMF protocol that’s used by Adobe Flex and ActionScript 3. (There’s a preview release of ActionScript 3 for Flash Professional on Adobe Labs.)
Adobe Flex allows developers to build Flash based user interfaces using an Eclipse based IDE, ActionScript (similar to JavaScript) and a declarative XML layout model.
This means that developers now have 3 choices when choosing which PHP package to use for Flex remoting. AMFPHP, SabreAMF and WebORB from the Midnight Coders all offer AMF3 support. They are all open source projects, with the WebORB project being the only one backed by a commercial entity.
Remoting scripts like these allow PHP developers to write applications that can translate PHP objects directly into ActionScript objects in Flex and Flash projects. Without these projects, PHP developers can still build solutions that output XML (REST interfaces), and then read in that XML with Flex and ActionScript directly. However, using one of the above projects allows you to bypass serializing data into XML and then deserializing it on the client – you can transfer objects, arrays and other data types directly from the backend server to the Flex / Flash application.
What’s this mean for PHP developers? Although AMFPHP is more complicated to learn, its more powerful than transfering XML data… For example, when querying a MySQL database, you can transfer the mysql_result object back to the client directly: it will be available to you as an array, and you can access the items in the array directly, without having to decode any XML.
Developers interested in building RIA solutions with PHP should check out the PHP RIA SDK by Adobe. This open source project contains libraries and a number of samples that show PHP developers how to build rich Internet applications with Flex, Flash and the Spry Ajax framework. There’s also a mailing list available.

Comments