Hello
I am trying to create an Adobe AIR widget using dojox.cometd for push. I get stuck with the dojox.cometd.init function. I try to call it after onLoad in an application sandbox content. This type of sandbox doesn't allow dynamic code generation after the onLoad event. So I get a "AIR runtime security violation for Javascript in application security sandbox (function constructor)".
Indeed, the init function calls this piece of code :
function(){
var _13c = function(arr, obj, cb){
return [dojo.isString(arr) ? arr.split("") : arr,
obj || dojo.global,
dojo.isString(cb) ? new Function("item", "index", "array", cb) : cb
];
}
Is the only solution to change the sandbox of my content ?
Furthermore, I tried to call the init function during onLoad. At that time, I should be allowed to perform dynamic code creation. I don't know what happens, the application just get stuck in the init function. No error message (or maybe there are some but I can't see them since dojo doesn't print in AIR introspector)
Has someone experimented that before ?
Regards

I have.
I found while writing an app that where you have to put your dojox.cometd.init() inside an addOnLoad function in the browser, it has to be fired BEFORE onload in AIR;
if(dojo.isAIR){
init();
}else{
dojo.addOnLoad(init);
}
hope this helps.
dojox.cometd 1.0 works in Adobe AIR but version 1.1 gets stuck
Thanks Dante for your answer. I couldn't get things fixed with your solution though. What I noticed is that cometd works perfectly fine in AIR if you use version 1.0 of Dojo. For some reason, the problem appears in version 1.1. Anybody knows what are the differences ?
I'd like to use the mini version of Dojo to package it within an AIR application. This mini release does not exist for Dojo 1.0.
I am confused...