 | Reference a variable comp name
on Dec 13, 2018 at 3:00:54 pm |
Hello AE community!
I'm trying to reference to a composition which is duplicated many times.
Let me give you an example:
I have a text layer named "Index" which changes value each time the comp is duplicated
For example, it's value is 1.
a = thisComp.layer("Index").text.sourceText;
x = comp("name 1" & a ).layer("^TV1").sourceRectAtTime(time).height;
I need it to be "name 1 1"
For example, it's value is 2.
a = thisComp.layer("Index").text.sourceText;
x = comp("name 1" & a ).layer("^TV1").sourceRectAtTime(time).height;
I need it to be "name 1 2"
Hope I've made it clear enough what's my problem ☺
Thanks!
 | Re: Reference a variable comp name on Dec 13, 2018 at 6:30:41 pm |
Try it this way:
a = thisComp.layer("Index").text.sourceText;
x = comp("name 1 " + a ).layer("^TV1").sourceRectAtTime(time).height;
Dan
 | Re: Reference a variable comp name on Dec 14, 2018 at 8:32:09 am |
Dan the Daysaver, thanks a lot, again!!! :)