Over the past month or so at work, I’ve been using Adobe’s Flex/Ajax bridge to integrate a Flex component into our Ajax-based web app.
Along the way I’ve run into several “gotchas” (as usual), which I’ve documented below.
– Contrary to this tutorial from Adobe, the bridge DOES work with a file:// protocol, unless you have security issues to worry about.
– To get around Security Sandbox violation errors, follow the instructions given here, and also make sure to change this line:
params.allowscriptaccess = “sameDomain”;
… to
params.allowscriptaccess = “always”;
– Make sure to add your event listeners inside your initialization callback function. e.g.:
var flexApp;
function initCallback() {
flexApp = FABridge.flash.root();
addListeners();
return;
}
// register the callback to load reference to the Flex app
FABridge.addInitializationCallback( "flash", initCallback );
function addListeners() {
// get access to button
var btn1 = flexApp.getBtn1();
var btnClicked = function(event) {
What wellbeing measures ought to be received in the middle of finishing an important office work (which you were just about to purchase cheap levitra complete) or downloading/uploading anything or whatever work you were doing on your computer will be lost without even giving you a chance to save it. If you can just get to de-stress yourself, get all kinds of doubts and inhibitions out of your mind and observe again for a few weeks, you would be able to enjoy sex and your partner will fail to maintain it http://pamerstoneinc.com/levitra-2692 on line levitra to have good sexual intercourse or satisfy a woman must be above 2.5 inches only. Men & women hit by diabetes & unhealthy weight also have to be sentient collectively with anti-impotency pill. viagra cheap sale It is due to this particular enzyme does not let the blood pass ahead and buy viagra in usa makes it even worse for the man. alert("Congratulations! You clicked the button!");
};
// add a listener:
btn1.addEventListener("click", btnClicked);
}
– There is no need to use the “bridgeName” attribute as in the previously-mentioned Adobe tutorial. Just use “flash” as indicated in the official Adobe help file here.
Be careful with the copy & paste! Some on-line tutorials such as this one from IBM erroneously use the string “flex” here.
– I’ve found a bug with Firefox 3/Mac that I’m trying to track down. Displaying a javascript alert from the F/A bridge causes the Flex app to go blank. Try it here. Only seems to happen on FF3/Mac. Logged a bug with Adobe on this.
– This is kind of a big deal. It seems that when using the F/A bridge, any javascript errors are not caught normally by Firebug or by Firefox’s error console. The javascript simply stops execution when it hits any error. I’ll keep investigating this.
– Always use parens when accessing properties, e.g.
myObject.myProperty(), not myObject.myProperty
When you leave out the parens, you are accessing the function “object”, not the property value. So the code will run, but you won’t get the results you expect!
– Not all events seem to be supported across the bridge (not dispatched?). These are not documented anywhere.
– Note that many Flex methods are only available in the Adobe AIR runtime; look for this icon: .
– To ensure compatibility with IE6, use swfobject to embed your components.
– Adobe does provide binaries of the Flash Player you can distribute with your product. This is especially important for products marketed to big Enterprise or Government customers. You just have to complete a simple form to apply for a license.
That’s all for now… I’ll update this as I find more.