Hi
im using .charCodeAt() to get a Unicode value from a textlayer to timeremap a precomp, this is working great to use custom graphics to type out words.
But im having a small problem with AE giving me an expression error if i use the charCodeAt() to read from a chararcter there is higher than the length of the textstrring of the text layer
This error is not really problematic since it renders fine.... but now that i have set up a larger project i have the expression warning banner tell me about 55 errors, and that is quite annoying.
Now im trying to use the Try Catch to get AE to ignore this error and not return a warning for each layer that has this expression reading outside the length of a textstring... but i cant get it to work.
What am i doing wrong.
the setup is as follows:
a precomp with a bitmat characters setup at framenumbers that match the Unicode value that .charCodeAt() returns.
This expression on the TimeRemap property of each copy of the character comp, this is character 3, aka copy 3 of this comp:
txtVal = thisComp.layer("ab").text.sourceText;
fps = 1/thisComp.frameDuration;
Ch = 3;
txtVal.charCodeAt(Ch-1)/fps
And the Try/Catch method i cant get to workÂ
txtVal = thisComp.layer("ab").text.sourceText;
fps = 1/thisComp.frameDuration;
Ch = 3;
try { txtVal.charCodeAt(Ch-1)/fps } catch(err) { 0 }
and a link to a screengrab of a simplified version of my setup: