Reloj digital en flash con date()
Ayer ponia el codigo de como crear un reloj analógico en falsh. Pues hoy os pongo el código para hacerlo en digital. Algo más sencillo que el anterior.
Código:
- onEnterFrame = function () {
- hora = timedate.getHours();
- minutos = timedate.getMinutes();
- segundos = timedate.getSeconds();
- fechadehoy = timedate.getDate();
- dia = timedate.getDay();
- mes = timedate.getMonth();
- año = timedate.getFullYear();
- if (length(minutos) == 1) {
- minutos = “0″+minutos;
- }
- if (length(segundos) == 1) {
- segundos = “0″+segundos;
- }
- time = hora+”:”+minutos+”:”+segundos;
- date = fechadehoy+”/”+mes+”/”+año;
- delete timedate;
- timedate = new Date();
- };
Ejemplo:
This movie requires Flash Player 8
3 comments November 28th, 2006