Onchange event with adobe air and javascript
I'm developing an application with adobe air and javascript. I have a select element where I added an onchange event . Every time the select change value the application make a ajax call to fetch data to populate another field. But I can not get any response from the server. Simply nothing happens. Anyone know any limitations to the event and how to overcome it?
select_object.addEventListener("change",callServer,false);
function callServer(event){
var a= event.currentTarget.value;
var variables = new air.URLVariables("value=" + a);
var u ="http://www.exemple.com";
var request = new air.URLRequest(u);
request.data = variables;
request.method = air.URLRequestMethod.POST;
loader = new air.URLLoader();
loader.dataFormat = air.URLLoaderDataFormat.TEXT;
loader.addEventListener(air.Event.COMPLETE, comp);
loader.addEventListener(air.Event.SECURITY_ERROR, function(event){alert('error');});
function comp(e) { alert('sucess') }
}
