views:

120

answers:

1

I 'm trying to build an AIR application using the HTML/JS engine (not flex nor flash), but I'm facing an issue while trying to load dynamically a JS file form the application directory.
Once the application has launched, if I try to load a script using jQuery.getScript method, the script is never interpreted and no error is thrown.

I've read about the security model of AIR and found that, in the Application sandbox, once the application is launched, nearly no new script can be added BUT the ones form the application directory.
So, I'm wondering why my script isn't interpreted. Is it due to the fact that jQuery append the script to the DOM and that this is prohibited? Is there a jQuery alternative? Or am I force do use the crappy AIR native API?

A: 

You should use the native API to retreive the text then eval() the text.. this will have the same general effect... probably want to do eval.call(window, scriptText) to make sure your namespacing/encapsulation is correct.

Tracker1
This cannot work as the eval method is too limited in the application sandbox. This could work is I was in the non-application sandbox but then I would not have access to the AIR API, except with bridges, which is more that annoying.
gizmo

related questions