Ver Mensaje Individual
  #4 (permalink)  
Antiguo 31/05/2006, 09:18
Avatar de luistar
luistar
 
Fecha de Ingreso: marzo-2005
Ubicación: Argentina
Mensajes: 939
Antigüedad: 19 años, 1 mes
Puntos: 0
o más sencillo, así:

al campo que tiene por variable: textdate ; ponle nombre de instancia: textdate
Código:
var dosCifras:Function = function(numero:Number):String{ return numero<10 ? '0'+numero : String(numero); }
var dias:Array = new Array('Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado');
var meses:Array = new Array('enero','febrero','marzo','abril','mayo','junio','julio','agosto','septiembre','octubre','noviembre','diciembre');
this.onEnterFrame = function(){
	var fecha_hoy:Date = new Date();
	var hora:Number = fecha_hoy.getHours()>12? fecha_hoy.getHours()-12:fecha_hoy.getHours(); //si es mayor que 12, se le resta
	var am_pm:String = hora>=12 ? 'p.m.' : 'a.m.';
	textdate.text = hora+':'+dosCifras(fecha_hoy.getMinutes())+':'+dosCifras(fecha_hoy.getSeconds())+' '+am_pm+' - '; //hora
	textdate.text += dias[fecha_hoy.getDay()]+' '+fecha_hoy.getDate()+' de '+meses[fecha_hoy.getMonth()]+' de '+fecha_hoy.getFullYear(); //fecha
}
Flash7 / ActionScript2
__________________
Si digo que soy mentiroso. ¿Lo soy?