Anyone used FABridge? Feedback on new project.
Anyone used the FABridge? It's supposed to be a simple way of talking back and forth between flex and javascript. Looking at those docs, it doesn't seem all that simple.
I found it while doing some research for an idea I was working on this weekend, a more-or-less transparent actionscript/javascript interface. I've completed phase 1, which is getting javascript objects into actionscript in a way where they can be used without worrying that they are javascript objects. It's pretty neat.
You can literally do this in Actionscript:
Code:
var body:Object = LookingGlass.$('body'); //uses existing $ function on js side if there. In this case, jquery.
var htmlDoc:Object = LookingGlass.eval('document'); //can use eval directly
var newDiv:Object = htmlDoc.createElement("DIV"); //call javascript object methods
newDiv.innerHTML = "whoa."; //set/get javascript object properties
newDiv.id = "anewDiv";
body.append(newDiv);
You can even get access to javascript functions and call them natively in actionscript, or pass them as values.
I'm planning through phase 2, which is obviously actionscript objects in javascript, which is what FABridge is supposed to do. I'd like to make it as transparent as the above code.
I'll be writing this up on my blog tonight, but wanted to know whether anyone will find it useful, or had suggestions.
Should I embed the JS code in the actionscript package, or have it as a separate file? Should the package have the option to auto-inject jquery or some other framework? I'm not sure of the copyright implications of bundling jquery, but since it's MIT licensed it should be fine.
Anyway, please bombard me with your thoughts and criticisms.