PDA

View Full Version : Decoding text problem


lsatdown
03-16-2006, 05:14 PM
Hi all,

Im trying to create a decoding text effect, ive found a few examples but the problem is that the sentance which i want to 'decode' contains words with different sizes/colours. CAN ANYONE HELP???

Heres the code:

header_text = "Welcome to the site.";

speed = 1;

delay = 30 ;

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;
}
}

Can the header text call from a text field on the stage? As this would be much easier because i could set out the sentance/colour/size etc. on the text field, and then call it.