how can i grab an object and rotate it with an object which is on it rotating [meaning that the second object is on the same possition on the first object?] can i make it being horizontal all the time?
:h:
put it on a seperate layer from the mc that’s rotating (or rotate it in the opposite direction at the same speed)
ie if its in a rotating star which is doing 1 rotation right every 10 frames, you could have it rotate 1 rotation left every 10 frames and it would stay in the same location
i’m not quite sure if this answers what you asked, but if i understood the question correctly, i think it does
*Originally posted by Voetsjoeba *
**:h: **
that’s what i mean
i’m refering to the small circle and if this can take place when i drag the big circle
hi._rotation = -hi._parent._rotation
that will rotate it by the same angle the big circle is rotated?
will it be horizontal?
in other words i want it to stay on the same spot of the big circle but without rotating itself ( not his own axis, only the big circle’s axis should be rotated.
You mean dragging hi along the circle, the line rotating, but hi not rotating ? Or is there no line ?
i put the line so i can show the rotation
but if the user cannot interact with the small circle, only to rotate the big circle how can ‘hi’ stay on the same spot of the big circle with out rotating on it’s axis??? i mean so it can be readable, horizontal?
So let me get this straight: you’re trying to drag the hi movieclip along the circle, but hi staying horizontal so you can read it at any point on the circle ?
Imagine that it is tacked by a nail like a wall clock. We can rotate the wall but the clock will remain in it’s possition, ‘readable’ and horizontal although it’s possition in relation to the enviroment wont be the same
this may help:
supposing the movement take place when i drag the big circle from right to the top
I guess you can understant what i want to say.
The anser to what you wrote before is yes.
this?
[edit]wooops, beaten to it[/edit]
That’s some sassy code! I took the short trail through the bushes on this one.
Nice code.
Here’s some code you can use to circular drag a movieclip:
MovieClip.prototype.circularDrag = function(cx, cy, radius) {
var hoek;
this.onMouseMove = function() {
_root._xmouse>cx ? hoek=Math.atan((cy-_root._ymouse)/(cx-_root._xmouse)) : hoek=Math.PI+Math.atan((cy-_root._ymouse)/(cx-_root._xmouse));
this._x = cx+Math.cos(hoek)*radius;
this._y = cy+Math.sin(hoek)*radius;
};
this.onRelease = this.onReleaseOutside=function () {
delete this.onMouseMove;
};
};
hi.onPress = function() {
this.circularDrag(350, 250, 150);
};
- Lol, double beaten
- (after viewing sen’s file) … Oooh, that’s what you meant ?
might not be mine… I dont think I understood the question fully anyway
seems to be enough going around to pick from though
and thanks Iammontoya
Yeah, I kinda gave the short answer and later realized he was looking to drag, in which case, sens code is more appropriate because it takes into consideration the speed differential.