Este es el codigo
Código ActionScript :
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.text.TextField;
import flash.events.MouseEvent;
var texto:TextField = new TextField ();
texto.text = "11111111111111"; //texto "11111111111"
var texto2:TextField = new TextField ();
texto2.text = "22222222"; //texto2 "22222222222"
var textomatrix:TextField = new TextField();
textomatrix.width=80;
textomatrix.height=30;
addChild(textomatrix); //Campo de texto Dinámico ( ¿Es TextField dinámico o de de usar otra clase?)
textomatrix.addEventListener(MouseEvent.ROLL_OVER, onOver); //Escuchador OVER
textomatrix.addEventListener(MouseEvent.ROLL_OUT, onOut); //Escuchador OUT
var i:Number = new Number(); //contador
function onOver (event:MouseEvent):void
{
textomatrix.text = "";
i=-1;
var temporizador:Timer = new Timer (60,texto.text.length);//tiempo entre cambios
temporizador.addEventListener(TimerEvent.TIMER, funciontempo1);
temporizador.start();
function funciontempo1 (event:TimerEvent):void
{
i+=1;
textomatrix.text = textomatrix.text + texto.text.charAt(i);
}
trace("onIn");
}
function onOut (event:MouseEvent):void
{
textomatrix.text = "";
i=-1;
var temporizador2:Timer = new Timer (60,texto2.text.length);//tiempo entre cambios
temporizador2.addEventListener(TimerEvent.TIMER, funciontempo2);
temporizador2.start();
function funciontempo2 (event:TimerEvent):void
{
i+=1;
textomatrix.text = textomatrix.text + texto2.text.charAt(i);
}
trace("onOut");
}
