PHPRemoting package
by Josh Strike
josh@joshstrike.com

Distribute freely, but please keep the readme with the file if you do.

NOTE: AS CONFIGURED, phpRemoting uses AMF3 to make calls. This means you'll need AMFPHP v. 1.9 (or later, if there ever is a later). However, in phpAccess.as is a single line that can be uncommented to make calls in AMF0.

What:
phpRemoting is a simple package for people who use AMFPHP and are switching to Flash CS3 / AS3. 
 It can be placed in any script and used to make calls to PHP services with a single initial setup line and a single line per call.
 It parses the returned result as either a Number, String, Array or RecordSet, and works as a fill-in for a real RecordSet class by translating inbound RecordSets into handy Arrays.
 It contains a feedback window that can hover in the movie itself, showing calls and returned data formatted in an easily readable way.

How:
Just put the phpRemoting folder in the directory with your main .fla file. Use the example to check it out.

Why:
Adobe conveniently failed to include AS3 remoting components in Flash CS3. Apparently they don't consider Flash a viable platform for information apps. Their attitude on it is somewhere between "go buy Flex" and "go **** yourself". Not that the original NetConnectionDebugger worked real well anyway; but that's another story...

V.1.3.6 UPDATE - Streamlined the log/walk routines so log is only kept when netDebug is true. Also switched over to AMF3 as the default, finally. Big speed increase from both. AMF3 still has some trouble returning multiple recordsets with similar field names, so it's recommended you use mysql_fetch_assoc to bring in arrays rather than raw recordsets if you're going to be returning more than one recordset at a time out of PHP.

V.1.3 UPDATE - Sealed all classes, some speed increase there. Renamed all the classes to conform to standards. Now implementing a singleton pattern that'll allow easier calls from all scripts to the same PHPAccess object / NetConnection.

V.1.2 UPDATE - THIS VERSION IS CONSIDERED STABLE FOR LONG-RUNNING BUSINESS OR KIOSK USE. PREVIOUS VERSIONS ARE *NOT*.
There was major memory leak in the previous versions. This has been addressed in two ways:
(1) There's now a required limit on the number of results to store (overload in the viewer list was causing browser crashes after too many large result sets).
(2) The NetConnection status listener is now WEAK REFERENCED. This made a HUGE difference. Thanks a million to Rezmason and his ActiveGraph class for helping track down the problem here.
---also fixed in this release---
:::There were graphics issues in the viewer when the stage was resized. The phpAccess class now requires you to put in a fixed width and height that you want the viewer to reference its concept of the stage size to.
:::AMF0 encoding is now on by default rather than AMF3. There's an apparent bug either in Flash 9's AMF3 encoder or in AMFPHP 1.9 that has the following effect: All calls through NetConnection which send at least one flash Array object and receive at least one MySQL result have that result return as null. This bug can be confirmed by making your own NetConnection object and passing an array to a PHP function that returns an unrelated MySQL result. I'll keep AMF0 as the default until this bug is fixed.

V.1.1 UPDATE - MySQL result sets are now recognized correctly when returned within the first level of a larger array from PHP...so that the included generic services actually work the way they're supposed to.

Cheers!