Cake 1.2 SWX problem solved

Recently I was asked to use SWX to tie into a CakePHP project. Integrating SWX was a piece of cake (cheap pun :) ), but in the middle of development, walker upgraded our Cake core to version 1.2 and all of our SWX started dying. If you have run into this problem, the fix is pretty simple:

edit all of your gateway files in your webroot (cake_amf_gatway.php, cake_json_gateway.php, and cake_swx_gateway.php) by replacing:



App::import('Controller', 'App')

that ought to take care of your BadCall errors.

For those unfamiliar, SWX is a new way of connecting Flash to webservices by Aral Balkan over at OSFlash. It is currently AS2, and creates SWF files on the server and loads them into your movie as a means of data exchange. It is really easy to use, and works on Flash mobile applications, but has been met with mixed feelings by the Flash community

I must admit that I was skeptical about using SWX, when AMFPHP has long been my remoting solution of choice. SWX ended up being really easy to use and very capable of getting the job done. I still prefer AMFPHP (especially the new amfphp1.9beta2 out now and amfphp2.0 hopefully on its way soon), but these two tools can work together, as Aral reminds skeptics in this post

Leave a Reply

Your email address will not be published. Required fields are marked *