The Expressions Thread

Pixelit_Plus said

That exactly what I was looking for!!! BIG Thanks!!!

Is there a way to help me with a second “object’s x position” slider?

What I need is object x position to REPLACE A FUNCTIONAL slider used as a background selector which background frames are in another comp.
So has to be step limited lets say 1 to 10 (every frame links a background choice)

This slider (used in a control panel) is a “selector” used in conjunction
with this script line:
state=comp(“1_For_Customization”).layer(“Controls”).effect(“Background”)(“ADBE Slider Control-0001”);
framesToTime(state);

WeTransfer Link of the slider surface selector already working which I want to replace an object x 10 stepped position:

What you basically need is an switch function. I used it in my universal counter in infographics kit template. I needed different currency sign in suffix (dollar, euro, yen etc). Drivable by slider control. So that value on slider was: 0=no suffix, 1=dollar, 2=euro etc.

switch(expression) {
case n:
code block
break;
case n:
code block
break;
default:
default code block
}