Copy link to clipboard
Copied
Hey,
I'm useing the checkbox to control the visibility of a layer by using the expression in my project. The expression is below:
if(comp("WAR_MASTER").layer("PLAYER_IMAGE_NUMBER_CTRL").effect("CHECK IF USE TWO IMAGES")("Checkbox")==1) 0 else 100
It worked well, and I just wonder whether it is possbile to make the opacity of this layer change only after a certain time (says after 1 sec) once I clickthe Checkbox?
Thanks very much.
Copy link to clipboard
Copied
Something like this maybe:
cb = comp("WAR_MASTER").layer("PLAYER_IMAGE_NUMBER_CTRL").effect("CHECK IF USE TWO IMAGES")("Checkbox");
delay = 1.0;
if (cb.numKeys > 0){
n = cb.nearestKey(time).index;
if (time < cb.key(n).time) n--;
if (n > 0){
if (cb.key(n).value){
t = time - cb.key(n).time;
t > delay ? 100 : 0;
}else{
0;
}
}else{
0;
}
}else{
cb.value ? 100: 0;
}
Copy link to clipboard
Copied
Thanks for your help. It seems not working on my project, but its' very inspiring.
I finnaly figured out another way to achieve what I'm after by useing a slider control with two key frames.
The two key frames are toggle hold keys on the opacity property, the first is 100% and the second is 0%, and the slider control is set on a null layer called "PLAYER_IMAGE_NUMBER_CTRL". The expression part is this:
Find more inspiration, events, and resources on the new Adobe Community
Explore Now