Rápido e fácil código: ver como criar um efeito de texto dactilografado com Actionscript 3. O texto a ser exibido será carregado de um arquivo txt.

1. Crie um novo arquivo Flash (ActionScript 3.0) e salve-o como typewriter.fla.

2. Altere o nome da "camada 1" para "ações". Abra o painel de ações.
Declare as seguintes variáveis:

var myText:String;
var counter:int = 0;


3. Criar um objeto TextFormat para formatar nosso texto.
var format : TextFormat = new TextFormat();
format.size = 16;
format.font = "Verdana";
format.bold = true;
format.color = 0xFFFFFF;


4. Crie um TextField, defina suas propriedades como segue e adicioná-lo à lista de exibição.
var textField : TextField = new TextField();
textField.width = 600;
textField.height = 350;
textField.selectable = false;
textField.wordWrap = true;
textField.defaultTextFormat = format;
textField.x = textField.y =10;
addChild(textField);


5. Em seguida, crie uma função que defina o initText myText "variáveis" para a string passada como argumento. Também adicione um ouvinte de evento ENTER_FRAME.
function initText(string:String):void{
	myText = string;
	addEventListener(Event.ENTER_FRAME, writeText);
}


6. WRITETEXT A função verifica se a variável contador é inferior ou igual ao comprimento de "myText".
Embora seja verdade, nós usamos o método substr que retorna uma substring composto dos caracteres que começam com o índice 0 e com um comprimento especificado pelo contador. Quando ela se torna falsa, nós removemos o ouvinte ENTER_FRAME.
function writeText(e:Event):void{
	if (counter <= myText.length){
   	     textField.text = myText.substr(0,counter);
   	     counter++;
	}
	else{
		removeEventListener(Event.ENTER_FRAME,writeText);
	}
}


7. O texto a ser exibida é armazenado dentro de um arquivo de texto. Portanto, criar o arquivo de texto, digite seu próprio texto e salvá-lo como text.txt dentro do mesmo diretório do arquivo FLA. Em seguida, carregar o arquivo. Quando a carga estiver completa, ele simplesmente chama a função initText.
var textLoader:URLLoader = new URLLoader(new URLRequest("text.txt"));
textLoader.addEventListener(Event.COMPLETE, function(e:Event){initText(e.target.data);});

8. Aqui está o código final, testar seu filme para ver em ação.
var myText:String;
var counter:int = 0; 

var format : TextFormat = new TextFormat();
format.size = 16;
format.font = "Verdana";
format.bold = true;
format.color = 0xFFFFFF; 

var textField : TextField = new TextField();
textField.width = 600;
textField.height = 350;
textField.selectable = false;
textField.wordWrap = true;
textField.defaultTextFormat = format;
textField.x = textField.y =10;
addChild(textField);

var textLoader:URLLoader = new URLLoader(new URLRequest("text.txt"));
textLoader.addEventListener(Event.COMPLETE, function(e:Event){initText(e.target.data);});

function initText(string:String):void{
	myText = string;
	addEventListener(Event.ENTER_FRAME, writeText);
}

function writeText(e:Event):void{
	if (counter <= myText.length){
   	     textField.text = myText.substr(0,counter);
   	     counter++;
	}
	else{
		removeEventListener(Event.ENTER_FRAME,writeText);
	}
}


Obrigado a todos, espero que tenham ajudado.
Arquivo Anexo