1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
lettre = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
Math_randomizer = function (longitud){
var c = random (longitud);
return c;
}
TextField.prototype.machine = function(texte, milliseconds) {
var index = 0;
var interval= 0;
var letra = 0;
this.$interv = function (){
/* tous les 10 une lettre apparait */
if(countero == 10){
countero = 0;
trace(letra);
letra++;
this.text = texte.substr(0, letra);
}else{
var d = Math_randomizer(texte.length);
trace(countero);
this.text = texte.substr(0, letra)+ texte.charAt(d);
if (countero == undefined) {
countero = 0;
}
countero ++;
}
if (letra == texte.length) {
trace('hola');
clearInterval(interval);
delete this.$interv;
}
index++;
};
interval = setInterval(this, "$interv", milliseconds);
};
t["texte"].machine('NEWS',20); |
Partager