CSInterface.evalScript callback scope
I'm trying to use the result of a call to the host application(After Effects), using CSInterface.evalScript, to modify the html:
var result = 'No result';
new CSInterface().evalScript('KT.getLayerNames("myComp")', function(res){
result = res;
alert(res);
})
alert(result)
The first alert throws the correct result, but the second keeps throwing 'No result'. I am confused, since normally this way of taking the results within a callback function works in javascript. I am missing something? Wich is the correct way to have the results available outside of the callback?
