# Simplify code

**URL:** <https://forum.kirupa.com/t/simplify-code/249942>\
**Category:** flash\
**Created:** [January 23, 2008, 10:16pm UTC](https://forum.kirupa.com/t/simplify-code/249942 "2008-01-23T22:16:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lolomedia](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@lolomedia](https://forum.kirupa.com/u/lolomedia)\
**Post date:** [January 23, 2008, 10:16pm UTC](https://forum.kirupa.com/t/simplify-code/249942/1 "2008-01-23T22:16:54Z")

</div>

Hello,

how can i simplify this code so i won’t have to write long lines of the same thing?

```auto

img.dot1.onRelease = function () {
    new Tween(img, "_x", Strong.easeIn, img._x, 347.7, .50, true);
    new Tween(img, "_y", Strong.easeIn, img._y, 447, .50, true);
}
img.dot2.onRelease = function () {
    new Tween(img, "_x", Strong.easeIn, img._x, 538, .50, true);
    new Tween(img, "_y", Strong.easeIn, img._y, 274, .50, true);
}
img.dot3.onRelease = function () {
    new Tween(img, "_x", Strong.easeIn, img._x, 538, .50, true);
    new Tween(img, "_y", Strong.easeIn, img._y, 274, .50, true);
}
img.dot4.onRelease = function () {
    new Tween(img, "_x", Strong.easeIn, img._x, 502, .50, true);
    new Tween(img, "_y", Strong.easeIn, img._y, 245, .50, true);
}
img.dot5.onRelease = function () {
    new Tween(img, "_x", Strong.easeIn, img._x, 502, .50, true);
    new Tween(img, "_y", Strong.easeIn, img._y, 245, .50, true);
}
img.dot6.onRelease = function () {
    new Tween(img, "_x", Strong.easeIn, img._x, 502, .50, true);
    new Tween(img, "_y", Strong.easeIn, img._y, 245, .50, true);
}

```

please advice.

thanks.:hitman2:
