-
increment text layer
Ok I give up. I have been search the forum and expression examples for a couple hours now and can’t figure out how to increment a text layer when certain conditions are met.
I have markers set on a null layer that tells me at what time goals were scored in a hockey game. So I want to increment up by one when I hit a marker when time = the marker time and the marker comment = 3. I have seen though debugging that I am getting inside the condition statement to increment up but for some reason it isn’t working. This expression is in the text layer I am trying to increment.
I posted the expression I have so far with no luck.
Thanks for any help.
Nick
if (time > 0)
{
curScore = parseInt(thisComp.layer("Away Score").text.sourceText);
c = thisComp.layer("Game Markers");
n = c.marker.nearestKey(time).index;if (c.marker.key(n).time == time && c.marker.key(n).comment == 3)
{
home = curScore + 1;
}
else
{
home = curScore;
}
//home = 'key:'+n+', cur:'+time+', keytime:'+c.marker.key(n).time+', comment:'+c.marker.key(n).comment+',score:'+
}
else
{
home = 0;
}home;
