Adobe AIR Looking in which AJAX framework to use with AIR ... Bruce mentions Mootools, so I give it a try ...

It seems finding a good AJAX framework to use with Adobe AIR isn't that easy. As Bruce mentions in his short article here : http://coderseye.com/2007/blueprint-css-air-grid-tool.html the problem with lots of code is the heavy use of the function "eval" (which anyways is forbidden by the clear code conduct, but anyways) and since Adobe turn out to be really cool guys they disabled the eval function in the beta 2 of AIR ( :P eval users)

Bruce points out he tried Mootools and he's really satisfied - no eval function used, and working pretty slick.

I find Mootools very useful as well, though when following the examples that are in the Mootools tutorial all of them were using the Firebug console for logging and I didn't want to change all the code I copy and paste, so here's a snippet which would help you keeping your debug logging consistent in the Firefox (aka the browser) and in the AIR

/**
* Overwrite the console object's log method
*/

function Console () {
this.log = function (msg) {
air.trace(msg);
}
return this;
}
console = new Console();

Include this AFTER you include the Mootools js file.
Now you can use your snippets or classes which you use also for the web.

console.log("start ")
var a = new Object();
console.log("start ")

Mootools is cool, easy and fancy. I think it's a good choice to go with for Adobe AIR

Marin

One Response to “Mootools AJAX framework and AIR”

  1. […] We load the AIR libraries, followed by mootools version 1.1 ( version 1.2.1 still has some issues with AIR 1.5 ). Mootools and ExtJS are the only valid “JS framework” candidates to not extensively use the eval function, dreaded by Adobe AIR, so no JQuery. […]

Leave a Reply 1,137 Views