-
1. Re: Make MC look at a targeted location
kglad Dec 26, 2009 11:20 PM (in response to d0brin)tween the movieclip's _rotation property.
-
2. Re: Make MC look at a targeted location
d0brin Dec 27, 2009 1:02 AM (in response to kglad)yes but how can you write me thx a lot
-
3. Re: Make MC look at a targeted location
kglad Dec 27, 2009 9:10 AM (in response to d0brin)import mx.transitions.Tween;
this.onMouseDown = function() {
t1 = new Tween(mc, "_x", mx.transitions.easing.None.easeNone,
mc._x, this._xmouse, 1, true);
t2 = new Tween(mc, "_y", mx.transitions.easing.None.easeNone,
mc._y, this._ymouse, 1, true);// you'll need to define c, a constant, that depends on your ref point
t3 = new Tween(mc, "_rotation", mx.transitions.easing.None.easeNone, mc._rotation,c+180*Math.atan2(mc._y-_ymouse,mc._x-_xmouse)/Math.PI, 1, true);
t1.onMotionFinished = function() {
// use mc.swapDepths() is mc is not at a removeable depth
mc.swapDepths(0);
_root.mc.gotoAndPlay("destroy");
};
};how to make it also to look at this location, not to stay static?



