Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to Apply specific values to a Slider Control

  • How to Apply specific values to a Slider Control

    Posted by Melvin Rodriguez on March 7, 2017 at 7:04 pm

    I’m trying to have a Slider Control to scrub trough a specific list of values.

    This is the list of values:
    0.7
    1.0
    1.2
    1.4
    1.8
    2.0
    2.5
    2.8
    3.5
    4.0
    4.5
    5.6
    6.7
    8.0
    9.5
    11
    13
    16
    19
    22
    27
    32
    38
    45
    54
    64

    I want to connect the slider to a text layer and have the text display whatever the slider value is from the list above.
    As you can see in the list above I want to be able to scrub the slider and have it only show those values.
    One decimal place in the first few numbers and no decimal place in the rest as the list above shows.
    I’m trying to figure out how to code this into the expression of the slider and the blue slider value as well.

    Also, can a list of strings be applied to a slider to have the slider scrub trough the list bellow?

    30″
    4″
    0″7
    4
    30
    500
    1000
    8000

    I want to connect this slider to a text layer and have the text be whatever the slider value is from the list above (including the quotation marks).

    Thank you for your assistance.

    Melvin Rodriguez replied 9 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Kevin Camp

    March 8, 2017 at 5:37 am

    Yes in both cases, but I would build your list of values as an array in the text layer, then use the slider to recall values from the array.

    v = effect(‘Slider Control’)(‘Slider’);
    myArray = [ ‘0.7’, ‘1.0’, ‘1.2’ ]; // continue adding your values between the brackets
    myArray[ Math.floor( v ) ]

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Melvin Rodriguez

    March 12, 2017 at 8:33 pm

    That works. Thank you for your assistance Kevin.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy