Bom Dia!
Eu tenho uma função ActionScript 3.0 que á a seguinte:
package br.com.shalon.ActionScript
{
import flash.events.TimerEvent;
import flash.utils.Timer;
public class datahora
{
public function datahora()
{
private var dh:Timer;
public function data_hora()
{
dh = new Timer(1000);
dh.addEventListener(TimerEvent.TIMER, atualizar_data_hora);
dh.start();
}
public function atualizar_data_hora(event:Event):void
{
var dh:Date = new Date();
lbl_data_hora.text = "Data: " + dh.getDate().toString()
+ "/" + (dh.getMonth()+1).toString()
+ "/" + dh.getFullYear().toString()
+ " Hora: " + dh.getHours().toString()
+ ":" + dh.getMinutes()
+ ":" + dh.getSeconds();
}
}
}
}
E na MXML eu tenho :
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundImage="imagens/aquagraphite.jpg"
layout="absolute">
<!-- ApplicationControlBar SUPERIOR(TOPO) -->
<mx:ApplicationControlBar x="0" width="100%" height="50" fillAlphas="[2.0, 0.0]" top="0"/>
<!-- ApplicationControlBar INFERIOR(RODAPÉ) -->
<mx:ApplicationControlBar x="0" width="100%" bottom="0" fillAlphas="[2.0, 0.0]" height="30">
<!-- LABEL DE DATA E HORAO NO ROPÉ -->
<mx:Label id="lbl_data_hora" fontSize="12" width="220" textAlign="left" fontWeight="normal"/>
</mx:ApplicationControlBar>
</mx:Application>
Eu tenho como descito acima o label(<!-- LABEL DE DATA E HORAO NO ROPÉ --> <mx:Label id=“lbl_data_hora” fontSize=“12” width=“220” textAlign=“left” fontWeight=“normal”/> e este label esta dentro de um ApplicationControlBar.) EU QUERO MOSTRAR A DATA E A HORA ATUALIZADAS DENTRO DESTE LABEL … MAS NÃO SEI COMO CHAMAR A FUNÇÃO QUE EU CRIEI NO ARQUIVO data_hora.as.
PERGUNTA: Como faço para chamar a função e fazer a mesma funcionar.
Obrigado!
