Home / Articles / Adobe Flash / Extending AJAX with the Flash/JavaScript Integration Kit

Extending AJAX with the Flash/JavaScript Integration Kit

Article Description

Want more control over the user experience? Because Flash makes graphical programming quick, easy, and attractive, and because JavaScript is very effective at manipulating HTML, they can be leveraged to focus on their strengths. Kris Hadlock shows you how to extend AJAX (Asynchronous JavaScript and XML) by cross-communicating between Flash and JavaScript. Discover how this technique enables technologies to focus on specialized tasks, and helps create the ultimate user experience.

Like this article? We recommend

Macromedia Flash MX 2004: Training from the Source

Macromedia Flash MX 2004: Training from the Source

$44.99

Flash to JavaScript

If you thought that communicating with Flash from JavaScript was easy, sending method calls to JavaScript from Flash is as simple as the following line of code:

proxy.call("highlightItem ", this.lender, "#ebebeb");

The JavaScriptProxy.call()takes the JavaScript method name written earlier and any number of parameters that you want to pass it. In the sample, I pass the highlightItem() method two parameters: the lender name and a hex value to change the background color of the div in the HTML for a particular lender. This provides the user immediate visual feedback and makes the content more effective.