Hey - I wanted to come up with a better way to cycle through text, like the way thats listed in the tutorials somewhere. I didn’t want to have to duplicate movieclips, and I didn’t want the letters to appear out of order. I think I came up with something pretty good, but I bet it can be improved upon…
[FONT=Courier New]
[/FONT][FONT=Courier New]
_root.onLoad = function() {
text = "BEATBOX INDUSTRIES TWO THOUSAND SIX";
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWQXYZ ";
letters = new Array();
i = 0;
}
_root.onEnterFrame = function() {
if (i < text.length) {
_root["letter"+i] == text.charAt(i) ? _root["letter"+i] = text.charAt(i) : _root["letter"+i] = alphabet.charAt(random(alphabet.length));
letters* = _root["letter"+i];
_root["letter"+i] == text.charAt(i) ? i++ : null;
_root["letter"+i] = alphabet.charAt(random(alphabet.length));
_root.text_txt.text = letters.join("");
}
if (Key.isDown(Key.CONTROL)) {
trace(text.length);
delete(letters);
letters = new Array();
text = text_2;
i = 0;
}
}
[/FONT]