Text color per letter expression help

Moderators: Disciple, zlovatt

Post Reply
Justinger
Posts: 2
Joined: October 24th, 2007, 3:10 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
Mylenium
Posts: 139
Joined: July 20th, 2005, 12:07 am

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
[Pour Mylène, ange sur terre]
Justinger
Posts: 2
Joined: October 24th, 2007, 3:10 pm

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
Post Reply