Advanced Camera Controls?

Hey Everybody!
I'm developing a landscape platformer like Mario, and I'm using the camera control to follow my main character along the 9000pixel wide scene. I have my camera set up to the typical 960 x 640 and the 'tracker box' in the middle is set up to 100 x 300 pixels. When my main character falls into that box the camera follows him, like it should, but, the problem is, by then, he's already half way through the screen and when you run along, you haven't got a chance to see the bad guys before they're melee attacking you...
Is there a way to contain the main character either a quarter or a third of the screen off of the left hand side of the edge? I've tried moving the camera box but it also moves the right side of the box, making it worse.....
Would be prefect !!!!!
Thanks in advance guys!!!
I'm developing a landscape platformer like Mario, and I'm using the camera control to follow my main character along the 9000pixel wide scene. I have my camera set up to the typical 960 x 640 and the 'tracker box' in the middle is set up to 100 x 300 pixels. When my main character falls into that box the camera follows him, like it should, but, the problem is, by then, he's already half way through the screen and when you run along, you haven't got a chance to see the bad guys before they're melee attacking you...
Is there a way to contain the main character either a quarter or a third of the screen off of the left hand side of the edge? I've tried moving the camera box but it also moves the right side of the box, making it worse.....

Thanks in advance guys!!!
Comments
Constrain current.scene.camera.origin.X to curent.scene.layers.background.mainplayer.position.X - 100
Constrain current.scene.camera.origin.Y to curent.scene.layers.background.mainplayer.position.Y - 100
Now here's the HUGE WARNING! - when you go into the layers section under current scene and use an attribute from another actor you must NOT create or reorder any layers in this scene. So make sure you have all layers in place before doing this. you can still add actors to any layers and you can also reorder actors within the same layer but if you move the actor that you are referencing to a new layer it will break this code and you will have to redo it. As long as you keep this in mind you will be good to go and this method uses the fewest constrains.
Good luck!