Hi, I found this awesome text effect class. Can anyone give me any ideas on how I would go about making this work multi-line? I’d also like it to reverse and erase itself on call. Any tips?
class com.texts.effects.TextAdd {
public static function makeText(textBox:TextField, theText:String, myInterval:Number):Void {
if (theText == undefined) theText = textBox.htmlText;
var textLength:Number = theText.length;
var letterCount1:Number = 0;
var letterCount2:Number = 0;
textBox.html = true;
var textInt:Number = setInterval(makeTheText, myInterval);
function makeTheText():Void {
if ( letterCount1 != textLength+1 ) { // MAKE RANDOM TEXT
var randomChar:String = String.fromCharCode (150 + Math.round(Math.random() * 90)); // set random character
textBox.htmlText += randomChar; // add random character
++letterCount1; // increase counting variable by 1
} else { // WRITE OUT YOUR INPUTTED TEXT
var oldTextBoxText = textBox.text;
var oldTextSplit:String = oldTextBoxText.substr(letterCount2, textLength-letterCount2+1) // split old character from counting variable to the length of the text string
var textSplit:String = theText.substr(0, letterCount2) // split new text string from 0 to counting variable
textBox.htmlText = "</font><font color=\"#999999\">"+textSplit+"/</font>"+oldTextSplit; // put splitted texts together
if ( letterCount2 == textLength+1 ) {
textBox.htmlText = "</font><font color=\"#666666\">"+theText+"</font>";
clearInterval(textInt);
}
++letterCount2;
}
}
}
}