ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Modifying Text Character Index Value with Slider Expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Gideon Nielson
Modifying Text Character Index Value with Slider Expression
on Jul 6, 2017 at 5:47:17 pm

I created two text layers. I typed one line on the one. I had the other one tell me what character letter where I indexed. For example, I typed, "Index me." When I indexed the third one, the second text layer should say, "d" in "Index me." The expression "thisComp.layer("Index me").text.sourceText.value[3]" does work, but when I added a slider expression (named "Indexing Character Value"), the expression was disabled and said, "Error at line 3 in property 'Source Text' of layer 2 ('Index'). property or method name '[object Property]' in Class 'String' is missing or does not exist. It may have been renamed, moved, deleted, or the name may have been mistyped."

Can you answer for that?

Thanks!

i = effect("Indexing Character Value")("Slider");

thisComp.layer("Index checking").text.sourceText.value[i]



Return to posts index

Dan Ebberts
Re: Modifying Text Character Index Value with Slider Expression
on Jul 6, 2017 at 8:18:53 pm

Try it this way:

txt = thisComp.layer("Index checking").text.sourceText.value;
i = clamp(Math.floor(effect("Indexing Character Value")("Slider").value),0,txt.length-1);
txt[i]


Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]