-
using if else to set a variable
Hi everyone, simple question I think,
Is my 5th line of code correct ?
I am trying to set this variable into a complicated expression, so I did not bother to paste the whole thing, only the problematic line.
Basically I want ”a” to be a variable depending on which layer in the precomp is turned on;
title=precomp1.source.layer(“title”);
title2=precomp1.source.layer(“title 2 lines”);
b=title.sourceRectAtTime();
c=title2.sourceRectAtTime();
if(comp(“precomp”).layer(“title”).active) var a = b else var a = c;
Thanks so much