Tom Lauck’s

Test Drive with Adobe’s PHP RIA SDK


A couple weeks ago, in response to a Flex tip I posted, Mike Potter from Adobe commented and left a link to his Google Group for the PHP RIA SDK. Having worked with Flex and AMFPHP, I found this SDK quite interesting. I noted that it had various basic/core examples that give a nice start when beginning your application. Included are examples using the Flex/AJAX Bridge, PHP/XML/Flex, AMFPHP, and (my new favorite) WebOrb.

It can be downloaded, here (2.5M zip).

Of course, you will probably end up making your *own* SDK, but I thought this was a good foundation, especially given the fact that it includes two different remoting options with sample services. From there, you can pretty much do anything. Additionally, now that Flex has been made available for Mac (Beta), workflows can become even quicker.

Nov 29 2006

Flex AMFPHP Variables


Working with XML in AS2 is to say the least, one of the dumbest and most redundant things in the world to me. Because of this, I use Flash Remoting. It just makes more sense. So when I moved on to Flex, even though XML is native in AS3, I still went with remoting. Mike Potter from Adobe had a basic tutorial on getting started with Remoting in Flex…for it is a little differnent from Flash. And those differences can really throw you, and leave yourself cursing at your own stupidity.

Here was my issue: Everything was going fine with my development, and I was falling even more in love with Flex and then all of a sudden, variables were not getting passed when I started debugging. Huh? So to make a long story short, the syntax for passing variables in Flex is a little different from the the standard/basic AMFPHP structure:

Rather than something like this:

public function getAllPages(){
	gateway = new RemotingConnection("http://localhost/flashservices/gateway.php"); "SitePages.getAllPages(php_variable)", new Responder(handleGetAllPages, onFault));

Notice the placement of the variable “php_variable” above.

You do something like this:

public function getAllPages(){
	gateway = new RemotingConnection("http://localhost/flashservices/gateway.php");"SitePages.getAllPages", new Responder(handleGetAllPages, onFault), php_variable);

Oct 31 2006