ive got two units (unit and unit1) could u help me with this code so i can move the units seperatly to different places in the scene.
For example: move unit1 to top left while unit stays still then move unit to top right are something while unit1 stays still.
import mx.transitions.Tween;
import mx.transitions.easing.*;
units = [“unit”,“unit1”];
units.onRelease = function(){
units.onMouseUp = function(){
var t1:Tween = new Tween(units, “_x”, None.easeNone, units._x, _xmouse, 5, true);
var t2:Tween = new Tween(units, “_y”, None.easeNone, units._y, _ymouse, 5, true);
dy = _root._ymouse-this._y;
dx = _root._xmouse-this._x;
radianrotation = Math.atan2(dy, dx);
radianrotation = radianrotation*180/Math.PI;
this._rotation = radianrotation;
delete units.onMouseUp;
}
}
some help would be great.