Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best method for Flex to PHP communication?

What is the best method for communication between Flex and PHP?

In the past, we used AMFPHP with AS2, and it worked great for the most part (advantage of AMFPHP is that it also has a JSON mode that can let you seamlessly use the same remote PHP with either Javascript or Actionscript frontends).

However, it seems like AMFPHP isn't realy maintained anymore. So what do people recommend to replace it? So far, what I've found is:

  1. Zend_AMF (looks too complex for us, we're not using the Zend framework otherwise)
  2. AMFPHP (there were some updated made to support Flex, and it seems fairly stable, but not sure on long-term support)
  3. XML (AS3 has nice XML handling routines, but it's more of a pain on the PHP side)
  4. WebORB (I have no experience with this)
  5. Roll-our-own using JSON or some other data-to-text serialization system (php's serialize(), XML, etc etc)

Mostly I'm leaning towards AMFPHP, even because of the downsides, since that's what I'm used to. Any reason I should consider switching to something else?

like image 595
davr Avatar asked Mar 16 '09 20:03

davr


2 Answers

If you want to have fast and efficient communication, I highly recommend sticking with an AMF protocol instead of a REST or JSON custom format.

ZendAMF is actually not very confusing. Watch the introduction tutorial on GotoAndLearn, it's quite simple.

And just so you know, some of the developers from AMFPHP moved to work on ZendAMF. So in a sense, ZendAMF is the continuation of AMFPHP.

like image 200
St. John Johnson Avatar answered Sep 21 '22 03:09

St. John Johnson


ZendAMF Good short read - http://theflashblog.com/?p=441

For me this is no brainer. The Zend framework is one of the best php frameworks out there, and now you can talk to Flash clients. Top it off with Adobe support, that's a done deal in my book.

Alternatives :

WebORB for php http://www.themidnightcoders.com/products/weborb-for-php

AMFPHP http://www.amfphp.com If you read the url above, you'll probably know why this is no longer on my radar.

like image 41
jerebear Avatar answered Sep 22 '22 03:09

jerebear