# Help me on this code

**URL:** <https://forum.kirupa.com/t/help-me-on-this-code/324147>\
**Category:** flash\
**Created:** [August 4, 2011, 5:06pm UTC](https://forum.kirupa.com/t/help-me-on-this-code/324147 "2011-08-04T17:06:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LukeElChul](https://avatars.discourse-cdn.com/v4/letter/l/e47774/32.png) [@LukeElChul](https://forum.kirupa.com/u/LukeElChul)\
**Post date:** [August 4, 2011, 5:06pm UTC](https://forum.kirupa.com/t/help-me-on-this-code/324147/1 "2011-08-04T17:06:28Z")

</div>

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.
