Home » News » Adobe Introduces FABridge, the ...

News by JavaScriptSearch


Adobe Introduces FABridge, the Flex Ajax Bridge

 

JavaScriptSearch
Wednesday, March 8, 2006; 01:26 PM

This new JavaScript library enables developers to easily integrate Flex applications with Ajax or DHTML code running in the browser.

The Flex Ajax Bridge (FABridge) is a small, unobtrusive library of code that you can insert into a Flex application, a Flex component, or even an empty SWF file to expose it to scripting in the browser.

To humbly borrow a page from the Ruby on Rails community, FABridge is built with the “don’t repeat yourself” principle in mind. Rather than having to define new, simplified APIs to expose a graph of ActionScript objects to JavaScript, with FABridge you can make your ActionScript classes available to JavaScript without any additional coding. Once you’ve inserted the library, pretty much anything you can do using ActionScript, you can do using JavaScript.

Flash Player has the ability natively, through the External API (the ExternalInterface class), to call JavaScript from ActionScript and vice versa. But 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. You’re limited in what you can do.
  • 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.

Advertisement

Partners

Related Resources

Other Resources

arrow