estoy usando coldfusion
por el momento lo que hice fue pedir la hora del servidor... mediante un XML
Código :
reloj_mc.onEnterFrame = function() {
GEvento_xml = new XML();
GEvento_xml.ignoreWhite = true;
GEvento_xml.load(URL+"/comp/HORA.cfc?method=getHora");
GEvento_xml.onLoad = function(exitoso) {
if (exitoso) {
trace("datos cargados HORA DEL SERVER" );
trace("---------------------------------");
horaC_ext = GEvento_xml.firstChild.firstchild.attributes.hora_actual;
hora_ext = GEvento_xml.firstChild.firstchild.attributes.hora;
min_ext = GEvento_xml.firstChild.firstchild.attributes.minuto;
seg_ext = GEvento_xml.firstChild.firstchild.attributes.seg;
//trace("---------------------------------");
} else {
trace("datos no cargados HORA DEL SERVER");
}
};//fin del load XML
hora = hora_ext;
minutos = min_ext;
segundos = seg_ext;
//asigno la rotacion de las aguajas con regla de tres simple
reloj_mc.hora_mc._rotation = (hora * 360) / 12;
reloj_mc.minutero_mc._rotation = (minutos * 360) / 60;
reloj_mc.segundero_mc._rotation = (segundos * 360)/ 60;
//establezco el texto del display
reloj_mc.hora_display=horaC_ext;
};
como pueden ver simplemente alteré el código de muestra de flash y le añadí el xml siguiente:
Código :
<cfcomponent>
<!--- Trae la hora --->
<cffunction name="getHora" access="remote" output="true">
<cfargument name="hora" type="numeric" required="true">
<node label="Evento">
<cfoutput>
<node hora_actual="#TimeFormat(now(), 'HH:mm:ss')#"
hora="#TimeFormat(now(), 'HH')#"
minuto="#TimeFormat(now(), 'mm')#"
seg="#TimeFormat(now(), 'ss')#"/> </cfoutput>
</node>
</cffunction>
</cfcomponent>
Ahora mi pregunta es: se puede hacer más sencillo o no? Creo que me compliqué mucho la existencia no?
Muchas gracias