An answer to AS3 AMFPHP problems.
This post contains a class package to simplify remoting in CS3.
I was really t/o'd that there's no NetConnectionDebugger in CS3, and I'm sure Adobe's gonna try and scalp people for it when it comes out.
I was also really unhappy that variables coming back from the NetConnection result now are not strong typed; they just come back as objects; this is especially a problem w/ RecordSets, since those objects can no longer simply be dumped into DataProviders if you just need to throw a mySQL result set into a table in Flash.
So I wrote this little package you all might enjoy, which does all the above and makes AMFPHP remoting once again as easy as it was under AS2, so you can make PHP calls with a single, simple line of AS3 code. It also provides a window that runs IN YOUR MOVIE (can be turned on or off, or hidden when it's on) that works like the NetConnectionDebugger, showing you all the calls, results and errors.
I needed to learn AS3, so this was my warm-up project. I hope you enjoy it, and please give feedback!
Download the package and example at: http://www.joshstrike.com/strike_remoting.zip
Cheers,
Josh
Update 1.2 Critical Bugs Fixed
Hey to all who are using my remoting package!
It came to my attention that the package was creating dreaded memory leak over time when dealing with large datasets. phpCall instances were accumulating unintentionally. Since this package was intended to be used in business environments, this was completely unacceptable.
I urge anyone using this package to upgrade to the new version (1.2), now downloadable at:
http://www.joshstrike.com/strike_remoting.zip
It fixes the above issue and also some graphics bugs. It requires you to change your initial phpAccess call to specify the stage width, height, and maximum number of calls to be held on the record, but those are the only changes you'll need to make to your code.
Also, if you're using this package, I'd recommend subscribing to this thread as this is where I'll be posting any future updates.
Cheers,
Josh