Killing AS easing once target is met

Okay, so as you can see below, the target for this mc is the edge of the screen/stage. I also have some AS on the time line that keeps this mc aligned with the edge of the stage if it’s stretched. The problem is the two codes conflict with one another to make the whole thing not work correctly.

I’m hoping someone here can help me put a ‘kill’ in the easing script so once the mc has hit its ‘targetX’ the enterframe function will stop, letting the AS on the timeline take over.

moveclip AS:

onClipEvent (load) {
	targetX = Stage.width-this._width;
}
onClipEvent (enterFrame) {
	this._x += (targetX-this._x)/10;
}

timeline AS:

stageListener = new Object();
stageListener.onResize = function() {
	positionBranches();
};
Stage.addListener(stageListener);
positionBranches = function () {
	rightBranch_mc._x = Stage.width-rightBranch_mc._width;
};

thanks!!

bump

Remove the AS on the mc and change the AS on the timeline like this

stageListener = new Object();
stageListener.onResize = function() {
	positionBranches();
};
Stage.addListener(stageListener);
positionBranches = function () {
	var tarx = Stage.width-rightBranch_mc._width;
	rightBranch_mc.onEnterFrame = function() {
		this._x += (tarx-this._x)/10;
		if (Math.abs(this._x-tarx)<1) {
			this._x = tarx;
			delete this.onEnterFrame;
		}
	};
};
stageListener.onResize();

scotty(-: