Interactive Movie Clip Scroller w/Easing

Hi guys,

Recently I’ve been developing a new site that runs 100% with noScale. What I’m aiming to achieve is the ability for the user to move their mouse up and down on the Y Axis to effectively scroll the site. (Without having to click)

I’ve tried adapting the Interactive Image Panner Actionscript from the Tutorial on kirupa - but it doesn’t seem to be working quite right :frowning: I’ve changed all the X Values to Y.


stop();

this.onMouseMove = function() {
	constrainedMove(bg_mc, 4, 1);
};
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {
	var mousePercent:Number = _ymouse/Stage.height;
	var mSpeed:Number;
	if (dir == 1) {
		mSpeed = 1-mousePercent;
	} else {
		mSpeed = mousePercent;
	}
	target.destY = Math.round(-((target._height-Stage.height)*mSpeed));
	target.onEnterFrame = function() {
		if (target._y == target.destY) {
			delete target.onEnterFrame;
		} else if (target._y>target.destY) {
			target._y -= Math.ceil((target._y-target.destY)*(speed/150));
		} else if (target._y<target.destY) {
			target._y += Math.ceil((target.destY-target._y)*(speed/150));
		}
	};
}

The zip containing the fla and html files are located here - http://www.archeradvertising.co.uk/kirupa/Archive.zip

If anyone can help I’d really appreciate it.

Cheers
David