FORUMS: list search recent posts

Animated toggle switch with time remap expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Lauri Inc
Animated toggle switch with time remap expression
on Nov 4, 2013 at 1:26:03 pm

I'm trying to create a very simple checkbox triggered toggle switch that uses time remap to play the toggle animation from off->on and on->off.

What I'm trying to do:

Checkbox off to on = play frames 1-18 and hold at frame 18
Checkbox on to off = play frames 18-36 and go to frame 1 (or stay at 36)

So basically I have bunch of toggle switches that I want to switch on and off in the video.


Following this example I got the toggle on and staying in the frame 18
http://forums.creativecow.net/thread/227/21190

But I cant figure out how to change that script or create a new one to make it work like I want.

Any help?

p = thisComp.layer("Toggle switch").effect("Checkbox Control")("Checkbox");
if (p.value){
gotit = false;
t = time;
while (t >= 0){
if (! p.valueAtTime(t)){
gotit = true;
break;
}
t -= thisComp.frameDuration;
}
if (gotit) Math.min(time-t,framesToTime(18)) else 0;
}else
0;


Return to posts index

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