The error message was thrown out, because you forgot the semicolon after sampler. But there were two more issues. You defined parameters for Construct, but didn't define them for the effect. You defined a float4 front but tried to access it as frontTex.
Here is the corrected code:
[code:3ft8mo3u]// World recolor
// PS 2.0
// Overlaps an object's color depending on its position in the screen
//#PARAM float redAdd 0.1 : RedShift : Adds red to the object.
//#PARAM float greenAdd 0.1 : GreenShift : Adds green to the object.
//#PARAM float blueAdd 0.1 : BlueShift : Adds blue to the object.
//special values extracted from construct
// texture BackgroundTexture;
sampler2D foreground = sampler_state
Texture = (ForegroundTexture);
MinFilter = Point;
MagFilter = Point;
MipFilter = Point;
float4 EffectProcess( float2 Tex : TEXCOORD0 ) : COLOR0
float4 front = tex2D(foreground, Tex.xy);
colorShifter.r = redAdd;
colorShifter.g = greenAdd;
colorShifter.b = blueAdd;
boxLeft.x *= 0.1;
//sin and cos functions are used for
front.rgb *= ((sin(boxLeft.x) - 2*cos(boxLeft.x)) * colorShifter.rgb)/colorShifter.rgb;
VertexShader = null;
PixelShader = compile ps_2_0 EffectProcess();
[quote="Valerien":3ft8mo3u]Also, is there a way to get the position of the object passed through the shader ? And to get a time value from construct please ?[/quote:3ft8mo3u]
I guess you already had a look at this page
The only "time value" you get is frameCounter, I'm afraid. Yes, it is not much...
For positions you have
all expressed as a number from 0 to 1, relative to the display.