Código ActionScript :
//Variables
var datosCliente:URLLoader= new URLLoader();
var direccionCliente:URLRequest=new URLRequest(this.parent.parent["direccionPrincipal"]+"phps/archivoparaingresardatos.php");
var variablesCliente:URLVariables=new URLVariables();
var datosLogin:URLLoader=new URLLoader();
var direccionLogin:URLRequest=new URLRequest(this.parent.parent["direccionPrincipal"]+"phps/archivoparaellogindelcliente.php");
var variablesLogin:URLVariables=new URLVariables();
//Listener
ayuda_btn.addEventListener(MouseEvent.CLICK,irPaginaAyuda);
ingresar_btn.addEventListener(MouseEvent.CLICK,ingresarCliente);
datosCliente.addEventListener(Event.COMPLETE,ingresarMascota);
ingresarLogin_btn.addEventListener(MouseEvent.CLICK,registrar);
datosLogin.addEventListener(Event.COMPLETE,entrarHabitacion);
nombremascota_txt.addEventListener(FocusEvent.FOCUS_IN,borrarStatus);
nombre_txt.addEventListener(FocusEvent.FOCUS_IN,borrarStatus);
paterno_txt.addEventListener(FocusEvent.FOCUS_IN,borrarStatus);
materno_txt.addEventListener(FocusEvent.FOCUS_IN,borrarStatus);
nacimiento_txt.addEventListener(FocusEvent.FOCUS_IN,borrarStatus);
nick_txt.addEventListener(FocusEvent.FOCUS_IN,borrarStatus);
contrasena_txt.addEventListener(FocusEvent.FOCUS_IN,borrarStatus);
nickLogin_txt.addEventListener(FocusEvent.FOCUS_IN,borrarStatus);
contrasenaLogin_txt.addEventListener(FocusEvent.FOCUS_IN,borrarStatus);
//Funciones
function borrarStatus(e:FocusEvent) {
status_txt.text="";
}
function irPaginaAyuda(e:MouseEvent) {
navigateToURL(new URLRequest("http://www.lapaginaweb.com/deayuda.html"));
}
function ingresarCliente(e:MouseEvent) {
if (nombremascota_txt.text==""||nombre_txt.text==""||paterno_txt.text==""||nacimiento_txt.text==""||correo_txt.text==""||contrasena_txt.text==""||nick_txt.text=="") {
status_txt.text="Por favor llena los campos requeridos";
} else {
variablesCliente.nombremascota=nombremascota_txt.text;
variablesCliente.sexomascota=sexomascota_cb.selectedItem.data;
variablesCliente.nombre=nombre_txt.text;
variablesCliente.paterno=paterno_txt.text;
variablesCliente.materno=materno_txt.text;
variablesCliente.sexo=sexo_cb.selectedItem.data;
variablesCliente.nacimiento=nacimiento_txt.text;
variablesCliente.correo=correo_txt.text;
variablesCliente.contrasena=contrasena_txt.text;
variablesCliente.nick=nick_txt.text;
direccionCliente.data=variablesCliente;
datosCliente.load(direccionCliente);
}
}
function ingresarMascota(e:Event) {
this.parent.parent["idCliente"]=e.target.data.elID;
this.parent.parent["nombreCliente"]=nombre_txt.text;
this.parent.parent["contenido"].load(new URLRequest("otroarchivoenseguida.swf"));
}
function registrar(e:MouseEvent) {
if (nickLogin_txt.text==""||contrasenaLogin_txt.text=="") {
status_txt.text="Por favor escribe bien tu nombre de usuario y contraseña";
} else {
variablesLogin.nick=nickLogin_txt.text;
variablesLogin.contrasena=contrasenaLogin_txt.text;
direccionLogin.data=variablesLogin;
datosLogin.load(direccionLogin);
}
}
function entrarHabitacion(e:Event) {
if (e.target.data.resultado=="no") {
status_txt.text="Datos incorrectos";
} else {
this.parent.parent["nombreCliente"]=nickLogin_txt.text;
this.parent.parent["idCliente"]=e.target.data.cliente;
this.parent.parent["tipoMascota"]=e.target.data.tipo;
this.parent.parent["habitacion"]=e.target.data.habitacion;
this.parent.parent["idMascota"]=e.target.data.mascota;
this.parent.parent["salud"]=e.target.data.salud-e.target.data.penalizacion;
this.parent.parent["dinero"]=e.target.data.dinero;
trace(e.target.data.penalizacion)
this.parent["parent"].actualizarSalud();
this.parent.parent["contenido"].load(new URLRequest("habitacion.swf"));
}
}
//Accion inmediata
sexo_cb.addItem({label:"NIÑO", data:1});
sexo_cb.addItem({label:"NIÑA", data:2});
sexomascota_cb.addItem({label:"HEMBRA", data:3});
sexomascota_cb.addItem({label:"MACHO", data:4});
direccionCliente.method=URLRequestMethod.POST;
direccionLogin.method=URLRequestMethod.POST;
datosLogin.dataFormat=URLLoaderDataFormat.VARIABLES;
datosCliente.dataFormat=URLLoaderDataFormat.VARIABLES;
.: En la parte del login no tengo ningun problema todo esta bien e ingresa como debe de ser: . Pero me arroja el error comentado, espero alguien me pueda ayudar a localizar mi error, GRACIAS foro!
