Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/11/2008, 15:40
Avatar de Lynxcraft
Lynxcraft
 
Fecha de Ingreso: noviembre-2007
Ubicación: yecla murcia
Mensajes: 1.346
Antigüedad: 16 años, 5 meses
Puntos: 51
Respuesta: Efecto máquina de escribir

supongo que utilizas esta función

http://www.cristalab.com/tips/34788/...-en-flash.html

bueno tienes que eliminar el intervalo antes de continuar es decir en esta parte del código pondrías algo asi

Código PHP:
nuevaLetra = function () {


boton1.onPress=function() {

clearInterval(campo.nuevoIntervalo);
}
boton2.onPress=function() {

clearInterval(campo.nuevoIntervalo);
}
boton3.onPress=function() {

clearInterval(campo.nuevoIntervalo);
}
////etc etc etc 

      
if (campo.letra == undefined) {
         
campo.0;
      } else {
         
campo.i++;
      } 
de todos modos yo hice una modificación de ese código para que pueda poner texto en html lo puedes ver aqui

http://www.creatusjuegos.com/foro/showthread.php?t=11

y si lo quieres en as3


es asi

Código PHP:
function Escribe(Texto:String,AreaTexto:TextField,Tiempo:Number,HTML:Boolean) {
    var 
fArr:Array = new Array();
    var 
m:Number 0;
    var 
arrayLetras:Array = new Array();
    var 
nut:String="";

    if (
HTML) {

        for (var 
i:Number 0i<Texto.lengthi++) {
            if (
Texto.substr(i1).indexOf("<") == -1) {
                
fArr.push(Texto.substr(i1));
            } else {
                var 
con:Number 1;
                for (var 
j:Number ij<Texto.lengthj++) {
                    if (
Texto.substr(j1).indexOf(">") == -1) {
                        
con++;
                    } else {
                        
fArr.push(Texto.substr(icon));
                        
j;
                        break;
                    }
                }
            }
        }
        
arrayLetras fArr;
    } else {

        
arrayLetras Texto.split("");
    }
    function 
max(event:TimerEvent):void {
        
nut+=arrayLetras[m];
        if (
HTML) {
            
AreaTexto.htmlText =nut;
        } else {
            
AreaTexto.text =nut;
        }
        
m++;

    }
    var 
miTimer:Timer= new Timer(Tiempo*100arrayLetras.length);
    
miTimer.addEventListener("timer"max);
    
miTimer.start();



se activa de forma similar al código as2 suerte
__________________
Sobran las ideas cuando faltan ganas de trabajar en ellas
Lynxcraft