Expressions and Javascript

I’ve been teaching myself how to code using Javascript to use in my animation work.

Expression-Test-01.gif

Expressions used:

loopOut("cycle" , 4)

thisComp.layer("Orbit").transform.position.valueAtTime (time - index+1)

Expression-Test-02.gif

Expressions used:

loopOut('cycle')

src = thisComp.layer("Blend").effect("Path Blend")("Slider"); 
a = thisComp.layer("Path 01").toWorld ([60, 60, 0]); 
b = thisComp.layer("Path 02").toWorld ([60, 60, 0]); 
linear (src, 0, 100, a, b)

Expression-Test-03.gif

Expressions used:

posterizeTime(12); value

w = thisComp.layer("Controller").effect("Dot Size")("Slider");
[w, w]

path = thisComp.layer("Controller").effect("Path Switch")("Slider"); 
a = thisComp.layer("Path 03").toWorld ([60,60,0]); 
b = thisComp.layer("Path 01").toWorld ([60,60,0]); 
c = thisComp.layer("Path 04").toWorld ([60,60,0]); 
d = thisComp.layer("Path 02").toWorld ([60,60,0]);

if(path <= 25){ 
linear (path, 0, 25, a, b); 
} else if (path >= 25 && path <= 50) { 
linear (path, 25, 50, b, c); 
} else if (path >= 50 && path <= 75) { 
linear (path, 50, 75, c, d); 
} else if (path >= 75 && path <= 100) { 
linear (path, 75, 100, d, a) 
}

loopOut('cycle')