In one of my other blog posts, someone pointed me towards the Flex AJAX bridge as an alternative to using Flex ExternalInterface. So I went ahead and had a look at it. Its currently in beta state and would need the Flash debug player to be notified of any errors etc while execution but apart from that, I think its an improvement over the ExternalInterface. As per the article, ExternalInterface has some limitations :-
- The ExternalInterface class requires you, the developer, to write a library of extra code in both ActionScript and JavaScript, to expose the functionality of your Flex application to JavaScript, and vice versa.
- The ExternalInterface class also limits what you can pass across the gap – primitive types, arrays, and simple objects are legal, but user-defined classes, with associated properties and methods, are off-limits.
- The ExternalInterface class enables you to define an interface so your JavaScript can call your ActionScript – FABridge essentially lets you write JavaScript instead of ActionScript.
I am gonna try it out soon and find out how good it works.