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

Expression Slider Control, when i had "%" it doesn't work anymore

New Here ,
Jan 02, 2025 Jan 02, 2025

Hi,

i'm looking for help about an expression for the effect slider,

when i'm using effect("Slider Control")("Slider").value.toFixed() it work

but as soon as i want to add a % at the end and use effect("Slider Control")("Slider").value.toFixed() + "%" the expression doesn't work at all anymore even just the start, does someone know how to resolve that ?

Thank you

(i'm putting screenshot for you to see, also english is not my first language so there may be errors)Capture d’écran 2025-01-02 à 10.10.13.pngCapture d’écran 2025-01-02 à 10.10.31.png

TOPICS
Error or problem , Expressions
629
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

Community Expert , Jan 02, 2025 Jan 02, 2025

Your screen shot isn't wide enough to show clearly, but it appears that maybe you added that expression to the Slider Control itself, rather than to the layer's Source Text property, is that correct?

Translate
Community Expert ,
Jan 02, 2025 Jan 02, 2025

Your screen shot isn't wide enough to show clearly, but it appears that maybe you added that expression to the Slider Control itself, rather than to the layer's Source Text property, is that correct?

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
New Here ,
Jan 02, 2025 Jan 02, 2025

Omg, thank you so much i was on it since yesterday i didn't understand and it was as simple as that !

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
New Here ,
Jan 02, 2025 Jan 02, 2025

and an other question if you know, is there a way that i can control de size of the "%" i add with the expression ? Thanks

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 Expert ,
Jan 02, 2025 Jan 02, 2025

Try this:

percentSize = 75;
txt = effect("Slider Control")("Slider").value.toFixed() + "%";
style.setFontSize(percentSize,txt.length-1,1).setText(txt);
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
New Here ,
Jan 02, 2025 Jan 02, 2025
LATEST

thank you soooo much, i have a lot to learn about the expressions in after effect ! Happy new year and have a great day 

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