Expression to flash a layer's opacity on and off

//to increase the speed of the animation, increase the freq value
freq = 1;
100*Math.sin(time*freq*Math.PI*2);

Example usage:

/**
* Apply to the OPACITY property of any layer
**/
freq = 1;
100*Math.sin(time*freq*Math.PI*2);

More advanced examples:

Cycle opacity between two values

In this example the opacity will alternate between 25 and 75

Note: You must set the opacity value to 50

freq = 1;
amp = 25;
offset = amp*Math.sin(time*freq*Math.PI*2);
value + offset;