ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How to Apply specific values to a Slider Control

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Melvin Rodriguez
How to Apply specific values to a Slider Control
on Mar 7, 2017 at 7:04:40 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.


Return to posts index

Kevin Camp
Re: How to Apply specific values to a Slider Control
on Mar 8, 2017 at 5:37:07 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


Return to posts index

Melvin Rodriguez
Re: How to Apply specific values to a Slider Control
on Mar 12, 2017 at 8:33:38 pm

That works. Thank you for your assistance Kevin.


Return to posts index

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