Hi there,
I have this problem…no worries it is only about ActionScript!
I have created two movieclips: one is called “sun_mc” (with a nice smile) and a ring of sunrays (short and long ones) called “ring_mc”.
the ring is situated around the sun.
The user clicks the sun and drags to rotate it.
The user can click the ring to rotate that too.
When the sun is rotating…the ring should not be…
and vice versa.
I have three problems…
- I can’t get the two mc’s to move independently
- When rotating the mouse position always jumps to a certain point on the movieclip…not the point where you clicked it first
- The ring is also rotating when the mouse is outside the ring…
What should I do?
I tried to obscure a part of the ring_mc with some masking…
That didn’t work.
Should I try hitTest? And how should I do that? That only works with squares doesn’t it?
Hopefully you can help!
kind regards
Merkske
_root.ring_mc.onMouseDown = function() {
this.onMouseMove = function() {
myRadians = Math.atan2(_root._ymouse-this._y, _root._xmouse-this._x);
myDegrees = Math.round((myRadians*180/Math.PI));
this._rotation = myDegrees+90;
_root.ring_mc._rotation = this._rotation;
};
};
_root.ring_mc.onMouseUp = function() {
if (this.onMouseMove) {
delete this.onMouseMove;
}
};
_root.sun_mc.onMouseDown = function() {
this.onMouseMove = function() {
var angle = Math.atan2(this._parent._ymouse-this._y, this._parent._xmouse-this._x);
this._rotation = angle*180/Math.PI;
_root.sun_mc._rotation = this._rotation+90;
};
};
_root.sun_mc.onMouseUp = function() {
if (this.onMouseMove) {
delete this.onMouseMove;
}
};