1 post tagged “amfphp”
FLA(sh) + LocalConnection + AMFPHP + Javascript + Actionscript + MXML
Since the introduction of the FABridge from Adobe, I've been creating javascript APIs as a shortcut to xmlhttprequest interactions. Since we are putting Flash on the page to display video anyway, there is not much more overhead in creating an ajax replacement. When including the as3corelib for JSON serializations (plus you get MD5 hashing, advanced string and date parsing, png/jpg encoder and more), it adds an extra 53KB.
Using AMFPHP, javascript uses the FABridge as a pass-through to call server side PHP functions. With as3corelib, objects and arrays can be transformed into JSON. The main advantage of JSON besides the obvious advantage of eval() is alleviating cross domain issues that can tangle Flash. Also, the CS3 components are much "lighter" than the Flex2 components (more on that later). Multiple swfs on a page or a shell SWF that loads in other SWFs works due to the use of the LocalConnection class. I've "borrowed" from Java frameworks and Cairngorm by implementing a quasi front controller (Cairngorm seems a bit "heavy" because what I envision is something a bit more RAD like Rails). I'm cleaning up the code and wrestling with rounding out the rest of the framework. Check back, more to come . . .