Foros del Web » Creando para Internet » Flash y Actionscript »

Cual es el fallo

Estas en el tema de Cual es el fallo en el foro de Flash y Actionscript en Foros del Web. Cual es el problema en este codigo al hacer un test de la pelicula todo bien, pero al publicar el swf el día y el ...
  #1 (permalink)  
Antiguo 05/12/2005, 09:21
Avatar de Xphoenix  
Fecha de Ingreso: abril-2004
Mensajes: 96
Antigüedad: 20 años
Puntos: 0
Cual es el fallo

Cual es el problema en este codigo al hacer un test de la pelicula todo bien, pero al publicar el swf el día y el mes me aparecen undefined.




format = new TextFormat();
format.font = "Arial";
format.color = "0xFFFFFF";
format.bold = true;


this.createTextField("hora_txt", 1, 150, 20, '', '');
this.hora_txt.autoSize = true;

this.createTextField("fecha_txt", 2, 150, 35, '', '');
this.fecha_txt.autoSize = true;

this.onLoad = function() {

dias = new Array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado");

meses = new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
};


this.onEnterFrame = function() {

tiempo = new Date();
dia = tiempo.getDay();
mes = tiempo.getMonth();
hoy = tiempo.getDate();
año = tiempo.getFullYear();
hora = tiempo.getHours();
minuto = tiempo.getMinutes();
segundo = tiempo.getSeconds();

if(hora>=12 && hora<=23){
meridiano = "P.M.";
} else {
meridiano = "A.M.";
}
if (hora == 0) {
hora = "12";
}

if (hora>12) {
hora -= 12;
}

if (hora<=9) {
hora = "0"+hora;
}
if (minuto<=9) {
minuto = "0"+minuto;
}
if (segundo<=9) {
segundo = "0"+segundo;
}

this.hora_txt.text = hora+":"+minuto+":"+segundo+" "+meridiano;
this.fecha_txt.text = dias[dia]+", "+hoy+" de "+meses[mes]+" de "+año;
// aplicamos el formato de texto anteriormente creado
this.hora_txt.setTextFormat(format);
this.fecha_txt.setTextFormat(format);
};
  #2 (permalink)  
Antiguo 05/12/2005, 09:30
Avatar de Bandit
Moderador
 
Fecha de Ingreso: julio-2003
Ubicación: Lima - Perú
Mensajes: 16.726
Antigüedad: 20 años, 9 meses
Puntos: 406
Hola Xphoenix:
El código está bien, allí no hay ningún error.

Espero haberte sido de ayuda.
__________________
Bandit.
Si no sabes estudia y si sabes enseña.
http://www.banditwebdesign.com/
  #3 (permalink)  
Antiguo 05/12/2005, 09:49
Avatar de lucasiramos  
Fecha de Ingreso: agosto-2004
Ubicación: Santa Rosa, La Pampa, Argentina
Mensajes: 1.484
Antigüedad: 19 años, 8 meses
Puntos: 13
Hola! Fijate este link para bajar, que esta corregido el tema de la fecha.

Espero te sirva.
Saludos. Lucas
  #4 (permalink)  
Antiguo 05/12/2005, 21:22
Avatar de Xphoenix  
Fecha de Ingreso: abril-2004
Mensajes: 96
Antigüedad: 20 años
Puntos: 0
Super bien gracias
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:36.