Hi.
I nedd to build a “See if you have the right weight” wheel in Flash.
It have to be a small wheel over a bigger one. The top one have to be drag and drop like it was pined to the other one, so it rotates around the center axis (when click and drag with the mouse over), allowing us to match the scales in the wheels as we like.
I’ve found a lot of tuturials about drag and drop objects in Flash, but freely, not around a fixed center axis.
Anyone could help me, please?
I’m really in a hurry to complete this project.
Thank you
I managed to get the effect I wanted with this code:
myDial_mc.onPress = function() {
pressing = true;
};
myDial_mc.onRelease = myDial_mc.onReleaseOutside=function () {
pressing = false;
};
_root.onEnterFrame = function() {
if (pressing == true) {
myRadians = Math.atan2((_ymouse-myDial_mc._y), (_xmouse-myDial_mc._x));
myDegrees = Math.round(myRadians*180/Math.PI);
myDisplay_txt.text = myDegrees+" degrees";
myDial_mc._rotation = myDegrees+90;
}
};
myDial_mc is the instance name of the moviclip containing the object you want to rotate.