Text color per letter expression help
Posted: October 24th, 2007, 4:26 pm
Hello,
I am trying to write an expression that assigns particular colors onto particular letters when you type them. I don't have much experience with AE expressions, and I can't figure out what is wrong. For example, I want "A" to be red, while "B" should always be blue. The expression below is my attempt. The result I get is the entire sentence becomes blue. It must not be recognizing this on a letter by letter basis. Any help would be great.
//code to change individual letter colors
//capital A
if (text.animator("Animator 1").property.characterValue = 65)
{
text.animator("Animator 1").property.fillColor = [1,0,0,1];
}
//capital B
if (text.animator("Animator 1").property.characterValue = 66)
{
text.animator("Animator 1").property.fillColor = [0,0,1,1];
}
Thanks,
Justin
I am trying to write an expression that assigns particular colors onto particular letters when you type them. I don't have much experience with AE expressions, and I can't figure out what is wrong. For example, I want "A" to be red, while "B" should always be blue. The expression below is my attempt. The result I get is the entire sentence becomes blue. It must not be recognizing this on a letter by letter basis. Any help would be great.
//code to change individual letter colors
//capital A
if (text.animator("Animator 1").property.characterValue = 65)
{
text.animator("Animator 1").property.fillColor = [1,0,0,1];
}
//capital B
if (text.animator("Animator 1").property.characterValue = 66)
{
text.animator("Animator 1").property.fillColor = [0,0,1,1];
}
Thanks,
Justin