Rotating a crank

I have this nifty crank . . . see cheesy image.

  1. I want to animate this crank so that a user can “grab” the handle w/ the cursor and rotate it lke a real crank around a central axis.

  2. it’ll be used as a navigation tool (forward/back) to scroll images.

  3. added bonus: the faster the crank is spun, the faster the images scroll?

thanks so much for your help!

hondo311

ok, this is my second way of trying to scroll images:

rotating the crank scrolls the images based on angle of rotation.
the problem is that when i let go of the mouse, the crank stops and “sticks” and doesn’t work any more.
i want the images to change as the crank is cranked, and be able to keep cranking in both directions during and after.

fla is attached.
here is the code for the crank:

mc.btn.onPress = function(){
scrolling = true;
}
mc.btn.onmouseUp = function(){
scrolling = false;
}
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) {
trace("angle = "+angle);
_root.changePhoto(1);
} else if (angle>175 && angle<=180) {
trace("angle = "+angle);
_root.changePhoto(-1);
}
}
}


images are also attached to test if it works. put them in a folder named “animation” in the same directory as the fla file.