You could also apply this expression, so that the fade will update even if the layer timing is changed later:
// set this value to the length of the dissolve you want, in seconds
dissolveTime = 3;
// if we don't have enough time to do both full dissolves the way we want, set the dissolve time to half the total duration.
if (outPoint - inPoint < dissolveTime * 2) dissolveTime = (outPoint - inPoint)/2;
// use linear interpolation to go from 0 to the nominal opacity value (100 by default, but adjustable or keyframable) as long as we're within dissolveTime seconds of the layer's in point,
// and vice versa for the out point. Otherwise, simply return the nominal value.
if (time-inPoint <= dissolveTime) linear(time-inPoint,0,dissolveTime,0,value)
else if (outPoint-thisComp.frameDuration-time <= dissolveTime) linear(outPoint-thisComp.frameDuration-time,0,dissolveTime,0,value)
else value;
Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog – What I’m thinking when my workstation’s thinking
Creative Cow Forum Host: Live & Stage Events