Dynamic fullscreen mouse pan/scroll

Hi,

I’ve been trying to allow a large MC to pan/scroll vertically according to the placement of the mouse on the stage; using Tweener.

I just can’t get the percentages right! For example: If the mouse is 30% down the stage, then the MC should pan/scroll up by 30% too.

import caurina.transitions.Tweener;

stage.align=StageAlign.TOP_LEFT;
stage.scaleMode=StageScaleMode.NO_SCALE;

mc.addEventListener(MouseEvent.MOUSE_MOVE,scroller);

function scroller(e:Event) {
	var mousePos:Number = stage.mouseY/stage.stageHeight*100;
	Tweener.addTween(mc, {y:-stage.height/100*mousePos
	,time:1, transition:"sunshine"});
}

My maths isn’t too sharp either, and I can’t work out the boundaries for the conditional rules. That’s why I can’t make the scroll action stop when the MC has gone too far upwards.

I’d really like your help on this one guys, this one has been driving me mad!

Thank you.

Mark