Mc panning


_root.onMouseMove = function() {
if (_root.video_target.hitTest(_root._xmouse, _root._ymouse, true)){
		slide(video_target.slider, 5, 1, 1);
	}
};


function slide(target:MovieClip, speed:Number, dir:Number, ver:Number) {
var xMove:Number = _xmouse/521;
var yMove:Number = _ymouse/315;
var xSpeed:Number;
var vSpeed:Number;
	if (dir != 1) {
		xSpeed = 1-xMove;
	} else {
		xSpeed = xMove;
	}
	if (ver != 1){
		vSpeed = 1-yMove;
	} else {
		vSpeed = yMove;
	}
target.destX = Math.round(-((target._width-521)*xSpeed));
target.destY = Math.round(-((target._height-315)*vSpeed));

target.onEnterFrame = function() {
	if (target._x == target.destX) {
		delete target.onEnterFrame;
	} else {
		target._x += Math.ceil((target.destX-target._x)*(speed/100));
	}
	if (target._y == target.destY){
		delete target.onEnterFrame;
	} else {
		target._y += Math.ceil((target.destY-target._y)*(speed/100));
	}
};
}

the preceding works exactly as i want it to… the catch is, it only does so in it’s own swf… meaning, i want to use it as an external swf embedded in another movie… when it’s on it’s own, the panning will stop if the edge of mc hits the border, when it’s called externally the panning won’t stop!

i feel like i’ve tried everything i can (obviously not!)… where you see 521 and 315 there WAS Stage.width/height and that code was on the external swf itself, in an attempt to stop the panning when it should i tried putting the code in the parent movie and changing some variables, which worked the same with no avail.

here’s a link if my babbling wasn’t clear enough: http://www.jahdesign.com/flash/

also… i would like for it to pan only if the mouse moves over the panning clip, it currently pans based on where the mouse is over the parent movie… i’ve made multiple attempts at changing this as well, with no luck… thanks