Ver Mensaje Individual
  #12 (permalink)  
Antiguo 14/07/2005, 23:36
Avatar de stock
stock
 
Fecha de Ingreso: junio-2004
Ubicación: Monterrey NL
Mensajes: 2.390
Antigüedad: 19 años, 9 meses
Puntos: 53
Ok, haber si te gusta esto

Código PHP:
var texto:String = new String("este es el texto que se va a desplegar");
var 
numLetras texto.length;
var 
i:Number 0;

this.onEnterFrame = function():Void{
    
contenedor.text "";
    if(
i%==0)
        
contenedor.text texto.substring(0,i) + "_";
    else
        
contenedor.text texto.substring(0,i);
    
i++;

con eso el cursos esta parpadeando

Hey, ya se, ya se hay un error en el codigo pues i esta incrementando y cuando llegue al final del STRING deberia arrojarme un error por desbordamiento.... (al menos en JAVA eso pasaria).....

pero por alguna razon no arroja ningun error ni nada, e leido la documetacion para saber por que no arroja el error, pero pues simplemente NO nos manda ningun desbordamiento ni nada....

bueno, en resumen, ese codigo FUNCIONA

string.substring();

Description
Method; returns a string consisting of the characters between the points specified by the start and end parameters. If the end parameter is not specified, the end of the substring is the end of the string. If the value of start equals the value of end, the method returns an empty string. If the value of start is greater than the value of end, the parameters are automatically swapped before the function executes and the original value is unchanged.