-
Change slider value ratio to percentage
Hi,
I’m trying to change the ratio value of my slider to make it as percentage.
Let me explain :
In my example, I have this text “This is a test” which is displayed word by word, one word at a time. So : “This” then “is” then “a” then “test”.
This text has a Source Text expression which is doing the word by word animation and is linked to a slider that can control which word is displayed, so 1=This / 2=is / 3=a / 4=test.
I have 2 keyframes to display the entire sentence over time : 1 to 4.
What I would like to do is being able to use the slider as a percentage while keeping the same function. Meaning that instead of my 2 keyframes 0 to 4, I would just put 1 to 100 (in this case 1=This / 100=test).
Is this even possible ? Thank you for your time, would really appreciate your help.
The expression I’m using for the word by word animation is this one :
t = value.split(” “);
i = Math.floor(effect(“Word”)(“Slider”))-1;
if (i<0) i = 0;
if (i>=t.length) i = t.length-1;
t[i];