-
1. Re: On click detection
kglad Dec 25, 2009 12:22 PM (in response to d0brin)you can use:
import mx.transitions.Tween;
this.onMouseDown = function() {
t1 = new Tween(mc, "_x", mx.transitions.easing.Elastic.easeOut, mc._x, this._xmouse, 3, true);
t2 = new Tween(mc, "_y", mx.transitions.easing.Elastic.easeOut, mc._y, this._ymouse, 3, true);
};
t1.onMotionFinished = function() {
// use mc.swapDepths() is mc is not at a removeable depth
mc.removeMovieClip();
}; -
2. Re: On click detection
d0brin Dec 26, 2009 4:51 AM (in response to kglad)thanks for replaying but i kind of don't stand how to use the code can you help me by making me a sample .fla file or just guide me whare to put the code and stuff ? thanks a lot
-
3. Re: On click detection
kglad Dec 26, 2009 7:10 AM (in response to d0brin)that should be:
import mx.transitions.Tween;
this.onMouseDown = function() {
t1 = new Tween(mc, "_x", mx.transitions.easing.Elastic.easeOut, mc._x, this._xmouse, 3, true);
t2 = new Tween(mc, "_y", mx.transitions.easing.Elastic.easeOut, mc._y, this._ymouse, 3, true);
t1.onMotionFinished = function() {
// use mc.swapDepths() is mc is not at a removeable depth
mc.swapDepths(0);
mc.removeMovieClip();
};
};-
Untitled-1.zip 5.2 K
-
-
4. Re: On click detection
d0brin Dec 26, 2009 9:27 AM (in response to kglad)thanks so much it roks now i forgot to add this import mx.transitions.Tween; just one more thing can it be made not to shuffle until it stops on the targeted location? or...
-
5. Re: On click detection
d0brin Dec 26, 2009 10:17 AM (in response to d0brin)oh and can you tell me how to edint this code:
onClipEvent(mouseMove) {
var radians:Number = new Number(Math.atan2(
_root._ymouse-this._y,_root._xmouse-this._x)
);
var degrees:Number = new Number(
Math.round((radians*180/Math.PI)));
this._rotation = degrees+360;
updateAfterEvent();
}to work not for the mouse cursor but for a designated movie clip from the main stage? this is to make the movie clip that i made to move on click to point at designated MC
-
6. Re: On click detection
kglad Dec 26, 2009 11:27 AM (in response to d0brin)change the easing to none:
t1 = new Tween(mc, "_x", mx.transitions.easing.None.easeNone, mc._x, this._xmouse, 3, true);
t2 = new Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, this._ymouse, 3, true);
p.s. if you're still able, mark this thread as answered.
-
-
8. Re: On click detection
d0brin Dec 26, 2009 1:06 PM (in response to d0brin)ah and one more thing how to make this position to reastarts when it ends...?
-
9. Re: On click detection
kglad Dec 26, 2009 2:43 PM (in response to d0brin)how do you make the mouse position do what?