Bueno pues el problema es el siguiente : estoy haciendo consultas a una base de datos pero el dato que me arroja el query los quiero usar fuera del servicio, no se si me explico, pongo el codigo para hacerlo mas facil ...
Código :
import mx.remoting.NetServices;
import mx.remoting.Connection;
var myArray:Array = Array();
mx.remoting.debug.NetDebug.initialize();
NetServices.setDefaultGatewayUrl("http://10.40.40.39/remoting/gateway.php");
conexion = NetServices.createGatewayConnection();
capturaRespuesta = new Object();
servicio = conexion.getService("incidencias",capturaRespuesta);
capturaRespuesta.onStatus= function(data){
trace("ta' madre un error, por:" +data.description);
}
/*** dato de seguridad ***/
capturaRespuesta.meca_seguridad_Result = function(data){
if (data){
if (data.getLength()){
seguridad=data.getItemAt(0).valor;
trace(seguridad); <-- aquí el trace me arroja 12 traido de la base de datos ( bien)
myArray.push(seguridad);
trace(myArray[0]); <-- aquí el trace me arroja 12 desde el array ( bien )
}else{
trace("no hay registros que mostrar de Seguridad ");
}
}else{
trace("ocurrio un error en la consulta");
}
}
servicio.meca_seguridad();
trace(myArray[0]); <-- aquí el trace me arroja indefinido ( y yo quiero el 12 anterior )
el punto es que yo quiero utilizar los valores del array fuera de la funcion capturaRespuesta.meca_seguridad_Result ... bueno esa es mi duda ...
gracias !!
