Pardon my ignorance… I can usually figure things out on my own but for some reason I’m not getting the results I’m looking for. I’d like to be able to change the color of certain words in the text field so I’m opting to load the text dynamically in order to add the tags I need.
Right now it just plays whatever text is inputted on the header_text line of the code below.
Problem I’m having is I’m not able to load the text into the field… I know I’m overlooking something but if someone could look at the code and let me know what i can do to load the text that would be appreciated.
// Title
// the text you want to display
// can be substituted for a external text file
header_text = "testtext.txt";
// Speed
// how many characters appear or "decode" at a time.
speed = 5;
// Delay
// delay before "decoding" begins.
// dependant on frame rate. a delay of 30 at 30fps would equal a 1 second delay
delay = 10 ;
//modify the following at your own risk!
header_length = header_text.length;
count = 0;
timer = 0;
onEnterFrame = function(){
random_text = "";
for (i=0;i<header_length;i++){
random_text += chr(random(57)+65);
}
header.htmlText = random_text;
timer++
if(timer > delay){
random_position = substring(random_text,count,header_length);
text_position = substring(header_text,0,count);
new_text = text_position + random_position;
header.htmlText = new_text;
count += speed;
}
}