Making Flash and Javascript speaks to each other

24 Mar 2011

I needed a Flash app and my Javascript code to be able to communicate. The
Flash needed to call some methods in the Javascript, and in turn the
Javascript needed to inject back some data into the Flash.

I let my Flash coder colleague took care of the Flash side, he needed to
implement ExternalInterface, register some callbacks methods that I could call
and more importantly change some security settings to make it work.

On my side, I just needed to get the objectelement holding the Flash
(thanks to swfobject.getObjectById it was pretty easy) and call the callback
method registered in Flash on it.