Help rotating an object in actionscript

I have a project I’m working on that requires a box to be rotated aropund an offset axis by dragging a button in one corner of the box. Most of the scripting for this works great, but there are a few things I can’t work out. The box is limited to an up and down position (0 degrees and 90 degrees respectively). This is what I want to happen — when the user drags the box from the up position and releases somewhere between 10 and 80 degrees, the box continues down to the end down position on its own. If it begins on the down position and is released midway, it continues up. For some mathematical reason, my version likes to orient around 50 degrees. Anyone have any suggestions?

Ideally, I would also like to make the drag motion smoother, but that is secondary to solving this movement problem. Thanks in advance!

grayehound

I am not sure I understand fully what you are trying to do.

I tried to download your file and I got an error. It said Unexpected file format :-\ I have Flash MX.

If you mean rotate as in clockwise and counterclockwise you can use a component for that. They have components I believe where you can drag it onto the clip and that allows you to hover over it which brings up a little icon and you can click and drag that icon to rotate… they also have it for scaling… it is awesome.

Well, I’m avoiding using components for now so I can improve my scripting. I resaved the .fla as a 5 file in case anyone else has problems with it.

I’ve got the drag and rotate part down well enough, but my problem is when the dragging stops, I want the box to move itself into the correct position (not just pop there) depending on where it started. I have it moving, but it doesn’t move in the right direction all the time and the movement is slow.

Thanks for the response, though!

Nope just downloaded and having same problem, im also using mx.

Unexpected file format!!