a simple one using ease could be something like this:
maxZ = 500; // this would be the z position where the layer would not be visible
ease(Math.abs(position[2]), maxZ, 0, 100, 0)
if you wanted more control over the fade falloff and the amount of distance that the layer could stay at 100% opacity, then this might be better:
noFalloff = 200; // this would be the 'zone' where the layer would be 100%
decay = .005; // use this to adjust how quickly the layer fades in/out
d = Math.abs(position[2]);
value/Math.exp((d-noFalloff)*decay)
-- the later expression is is based on dan ebbert's light falloff expression here, if you'd like a full description of what it's doing:
http://www.motionscript.com/design-guide/falloff.html
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW