Hi every one,
I've been reading some of the posts about "Remoting with AS3 (Flash-Flex examples) SimplePerson class" needing help cause it doesn't work for X,Y,Z reason.
I've been experiencing just about the same BadConnection error when testing the samples extracted from the ZIP as is!
OK... The answer is quite simple in fact. If your AMFPHP installation work fine with the HelloWord sample and the DiscoveryService installed with your copy of AMFPHP check code for a couple of thing. They are missing in the sample files from the tutorials.
First : Never assume that the <? opening tag in the file IS ok with YOUR setup of PHP... As I remember Default distribution of PHP 5 come with the short starting tag option disabled so use <?php instead. Some other distributions may come with other configuration.
I don't want to blast but good tutorials should ALWAYS use STANDARD coding so they are usable by every one!
Secondo: AMFPHP NEED A "METHODS TABLE" in the constructor of the class OR that you use include_once(AMFPHP_BASE . "shared/util/MethodTable.php"); before the class definition so AMFPHP take the time to create is own methods table for export to flash.
Finaly, you should edit sample files from any tutorials and save it back with proper encoding. So if by default your PHP is using UTF-8 save your files in UTF-8. By the way UTF-8 is the prefered encoding of Flash when doing remoting (Was with my old Flash CS i'didn't had the time to check in CS3)
After correcting those little things the sample files work fine in AMFPHP Services Browser and I was able to test their methods outputs.
Ohhh, By the way, Nice tutorials... Once corrected I've been able to work on another project of mine that I'm upgraging to CS3. The PHP side was OK since it already use AMFPHP but I needed the Flash CS3 side.
Have fun coding!