source text and layers/pre-comps

Moderators: Disciple, zlovatt

Post Reply
wyz
Posts: 3
Joined: May 23rd, 2005, 5:38 pm
Location: Barcelona, Spain

Hey guys!
Is there a way to make source text drive individual animated letter layers or pre-comps?
For instance, an "A" comp or layer would be displayed when source text from a text layer has an "A". Any thoughts?
Thanks!
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

Sure. Here's an opacity expression that would make a layer invisible unless the first character of the text in "My Text Layer" is "A":

txt = thisComp.layer("My Text Layer").text.sourceText;
txt[0] == "A" ? 100 : 0


Dan
wyz
Posts: 3
Joined: May 23rd, 2005, 5:38 pm
Location: Barcelona, Spain

Dan thanks It works great!! I really admire the way you code, really clean and direct, i was trying to do something like this:

var a = "Super";
var myText = a;
if (a.substring(0).match("S")) {
myText = "Yes it maches";
(doStuff to layers here)
}
Post Reply