Centering until a certain x value

Im stumped, I know theres probably a simple solution but it’s escaping me at the moment.

I have a centered swf, I want it to stop centering if the swf reaches the side nav so they dont overlap.

function Center(mc) {
mc.onEnterFrame = function() {
if(mc._x >500){
mc._x = Stage.width/2;
mc._y = Stage.height/2;

	}
};

}

this stops the centering when it hits 500, but it stops all centering because it’s stuck on 500.

what about this?


function Center(mc)
{
	mc.onEnterFrame = function()
	{
		if (mc._x > (nav._x + nav._width))
		{
			mc._x = Stage.width / 2;
			mc._y = Stage.height / 2;
		}
	};
}

ill try that, but i dont thin it’ll work either.

its going to get stuck on that specific value.

any ideas people?