Skip to main content
Participant
February 27, 2024
Answered

Linking/limiting slider expression controls

  • February 27, 2024
  • 1 reply
  • 363 views

I have created two sliders, one which will control the start point of a layer (if then statement looks at the time of the CTI and the slider time, in seconds) and if the CTI is greater than the slider time, then the opacity is set to 100) and the other to control the end point of the same layer (same thing as the start point, except it turns the opacity to 0).



I would like to set it up so that if, say the end slider is set to 15 seconds, then the start slider either cannot move further than 15 or the start slider "pushes" the end slider higher up the scale. What happens now is that the start time can be set after the end time, which simply prevents the opacity from changing.


I'm not sure if it's possible to limit the movement of a slider based on another slider's value, or move a slider based on another slider's value, but if it is, please let me know.

Additionally, if there's another method instead of using two sliders, please feel free to share, but I'd rather keep with this, unless the other method is something like two sliders in one.

I hope this made sense.

This topic has been closed for replies.
Correct answer Airweb_AE

Try this:

Start Time Slider:

endTime = effect("End Time")(1);
Math.min(value,endTime)

 

End Time Slider:

startTime = effect("Start Time")(1);
Math.max(startTime,value)

1 reply

Airweb_AECorrect answer
Legend
February 27, 2024

Try this:

Start Time Slider:

endTime = effect("End Time")(1);
Math.min(value,endTime)

 

End Time Slider:

startTime = effect("Start Time")(1);
Math.max(startTime,value)
Jeff C.Author
Participant
February 29, 2024

Works great! Thanks!