Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Source Text slider apparition

Community Beginner ,
Apr 24, 2014 Apr 24, 2014

Hi,

I would like to use a slider to display a text (when the slider value is 0, the source text display nothing, when it is 10, the source text display the 10 first letters etc...). Like the Typewriter animation effect (but I need it with a Source Text expression)

I created a slider named "TextSlicer"

Wrote a text layer

And this expression in Source Text :

try

{

text.sourceText.split("")[Math.round(effect("TextSlicer")("Slider"))] 

}

catch(err)

{text.sourceText }

With this expression, I can display one letter at time.

My goal would be to display N letters, based on the slider value :

text.sourceText.split("")[0] + text.sourceText.split("")[1] + text.sourceText.split("")[2] + text.sourceText.split("") ............

Thanks !

TOPICS
Expressions
779
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Apr 24, 2014 Apr 24, 2014

fullText = "blah blah";

numLetters = Math.floor(effect("TextSlicer")("Slider").value);

fullText.substr(0,numLetters);

You can also let the text constant, and add a Text Animator > opacity.

Xavier.

Translate
Advocate ,
Apr 24, 2014 Apr 24, 2014

fullText = "blah blah";

numLetters = Math.floor(effect("TextSlicer")("Slider").value);

fullText.substr(0,numLetters);

You can also let the text constant, and add a Text Animator > opacity.

Xavier.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 24, 2014 Apr 24, 2014
LATEST

Thank you Xavier!

It works perfectly.

I just lost my Source Text attributes (different text sizes). I know this is a known behavior with Source Text, any idea for a workaround ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines