# \[FMX\] Button movement in AS

**URL:** <https://forum.kirupa.com/t/fmx-button-movement-in-as/145629>\
**Category:** Uncategorized\
**Created:** [April 24, 2005, 9:53am UTC](https://forum.kirupa.com/t/fmx-button-movement-in-as/145629 "2005-04-24T09:53:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![syp](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@syp](https://forum.kirupa.com/u/syp)\
**Post date:** [April 24, 2005, 9:53am UTC](https://forum.kirupa.com/t/fmx-button-movement-in-as/145629/1 "2005-04-24T09:53:50Z")

</div>

ok…all the tutorials for movement in actionscript seem to use the onclipeven(on enter) as well as only refer to movie clips.

so this is what i want to do in the simplest sense.

RedButton is starts at position RedA. If you click it on position RedA, it moves to position B. If you click it on Position B, it moves to Position C. If you click on position C, it goes back to B.

I basically want a 7 buttons to move around using actionscript. They each have a their own “home” spot as well as 2 “shared” spots where the active button will sit.

i tried a simple function similar to:

red\_btn.onPress = function (){  
if (this.\_x = 360)//at active  
{  
this.\_x = 20;//go to loading  
this.\_y = 400;  
}  
else if (this.\_y = 400)//if loading  
{  
this.\_x = 260; //go to inactive  
this.\_y = 60;  
}  
else if (this.\_x = 260)//if inactive  
{  
this.\_x = 360; //go to active  
this.\_y = 360;  
}  
}

So theres obviously a huge mistake in my logic because it doesnt work at all, not the mention i dont get any movement, just kinda…teleporting buttons, which is not what i want. tia.
