I have been working with Flash AMFPHP and man is it sweet stuff. I modified my own PHP classes that I created for database connectivity, to let me optionally test any function I create in the AMFPHP service using a PHP call instead of going all the way through to Flash to test it. It’s also nice to have this because I can test any PHP errors using the following lines at the top of my code to return any PHP errors I may have thrown in by accident:
(Yes, I know I could turn on display_errors in the php.ini, and I tried that. It says that it’s On, but in phpinfo() it says that it’s off. I don’t know why, but the above lines work just as well and are more secure in the long run since I can remove the lines easily.)
Oh, right, the subject of this post… So, another problem I found was a delay when it got all the way through to Flash. I’d attempt a call and it either wouldn’t work at all, or it would delay. Sometimes I had to send the call or click the button twice to get it to respond.
I narrowed that problem down to the NetDebug class that I include and use to test my stuff inside Flash. By removing/commenting the lines that use the NetDebug class, it removes that delay.
I hope someone can learn from my AMFPHP/Flash problems as I go. If you have questions about any of this, as always, feel free to leave a comment. I’ll try to answer to the best of my ability.