Service class path for AMFPHP
January 27th, 2008
I am frequently asked how to call services that are in folders inside of the amfphp/services/ directory. To do this you just use dot notation on NetConnection.call method. If you download the amfphp examples I am going to use the HelloWorld example and place it into a subfolder.
On the server make a directory inside of of your amfphp/services/ folder:
amfphp/services/sub/
Upload or move the HelloWorld.php file into your new directory.
Open flash and open the Main.as file that goes with the example. Go to line 36 and change the call to have the folder name then a dot.
connection.call("sub.HelloWorld.say", responder, params);
You are now making calls to a sub directory inside your services folder!


what AS3 Remoting Framework do you use usually? SSR? AS3 Lightweight?
I actually have my own service locater class that I use inside of Flash. Looking at AS3 Lightweight it seems to be about the same. In flex I use RemoteObject in Caringorm.
I’m trying to set up amfphp so that the services directory is on the same level as the amfphp directory. I have configured my classpath accordingly in the gateway, but I only get the ‘ faultCode = “AMFPHP_CLASSPATH_NOT_FOUND” ‘ error when I use the ServiceBrowser. Is having the services dir on the same level (so not as a subdir) at all possible?
by the way: the goal is to set up a central amfphp for multiple websites and only having a separate services folder and globals.php for every website
make the classpath /../ and this will do the trick.
oh my god, just made a regular typo.. didn’t see it for hours. Thnx anyway Wade…
I now have it set up for 14 websites and I can do 1 svn update of amfphp for all
is just incredible the number of websites with the amfphp browser visible to anyone.
amfphp = <3
thank-you!