Image viewer

here is some code for a rotating crank that controls an image gallery.
refer to the “image viewer stops?” thread in the flash mx forum (sorry don’t know how to link to a forum yet!) for more info. attached is the fla.

i want to be able to crank clockwise to scroll images forward and counterclockwise to scroll images backwards. If i keep cranking, i want the images to continue to change, if i stop cranking, i want it to stp on that image. it doesn’t sem tooooo hard, i’m just numb from tryig to figure it out.

thanks!


 code for crank
---------------------------------------
mc.btn.onPress = function() {
	scrolling = true;
};
mc.btn.onmouseUp = function() {
	scrolling = false;
};
mc.onEnterFrame = function() {
	if (scrolling) {
		var dx = mc._x-_xmouse;
		var dy = mc._y-_ymouse;
		var rad = Math.atan2(-dy, -dx);
		var angle = (rad*180)/Math.PI;
		mc._rotation = angle;
		if (angle>85 && angle<=90) {
			_root.changePhoto(1);
		} else if (angle>175 && angle<=180) {
			_root.changePhoto(-1);
		}
	}
};