Page 1 of 1

Text color per letter expression help

Posted: October 24th, 2007, 4:26 pm
by Justinger
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

Posted: October 24th, 2007, 11:10 pm
by Mylenium
See my reply at CGTalk. Please do not cross-post in the future. It's inefficient and will only cause confusion. If nobody else, I'll be around regularly at CGTalk, so you don't need to be afraifd that noone will hear you... ;o)

Mylenium

Posted: October 25th, 2007, 7:41 am
by Justinger
Sounds great. Client needs it quickly, and I was trying to cover more ground. For anyone who finds this looking for the solution, Mylenium posted it here:

http://forums.cgsociety.org/showthread. ... ost4732520

Thanks much,
Justin