# \[FMX\]Controlling x positions from one movieclip with 4 buttons

**URL:** <https://forum.kirupa.com/t/fmx-controlling-x-positions-from-one-movieclip-with-4-buttons/108500>\
**Category:** Uncategorized\
**Created:** [April 26, 2004, 8:55am UTC](https://forum.kirupa.com/t/fmx-controlling-x-positions-from-one-movieclip-with-4-buttons/108500 "2004-04-26T08:55:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dboers](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@dboers](https://forum.kirupa.com/u/dboers)\
**Post date:** [April 26, 2004, 8:55am UTC](https://forum.kirupa.com/t/fmx-controlling-x-positions-from-one-movieclip-with-4-buttons/108500/1 "2004-04-26T08:55:13Z")

</div>

Hi,

I have a text movieclip (service\_mc) on the stage for which I need to control 4 different \_xpositions (\_x = 0, \_x = -700, \_x = -1400, x = -2100) with 4 button mc’s (btn\_one, btn\_two, btn\_three, btn\_four).

For these four buttons I already declared the Over, Out, Release and Restore stage in a function:

```auto
for (var i in this) {
if (this*._name.substr(0, 4) == "btn_") {
setKnop(this*._name);
}
}
function setKnop(clip) {
var clip = eval(clip);
clip.onRollOver = function() {
	new Color(this).setRGB(0xA10000);
};
}

```

etc., etc.

For the easing movement of service\_mc I declared the following function:

```auto
function movoClip (x){
this.onEnterFrame= function(){
this._x += (x - this._x)/5;
}
}

```

What I like to accomplish is to control the \_x positions of “service\_mc” with the same buttons. I mean when btn\_one is pressed service\_mc should go to \_x = 0, when btn\_two is pressed the \_x position from service\_mc should change to \_x = -700 etc, etc

How to integrate this possibility in the existing function?
