# A problem to move Buttons thru programming. A twister?

**URL:** <https://forum.kirupa.com/t/a-problem-to-move-buttons-thru-programming-a-twister/325474>\
**Category:** Uncategorized\
**Created:** [October 18, 2011, 5:14am UTC](https://forum.kirupa.com/t/a-problem-to-move-buttons-thru-programming-a-twister/325474 "2011-10-18T05:14:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajoo](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@ajoo](https://forum.kirupa.com/u/ajoo)\
**Post date:** [October 18, 2011, 5:14am UTC](https://forum.kirupa.com/t/a-problem-to-move-buttons-thru-programming-a-twister/325474/1 "2011-10-18T05:14:49Z")

</div>

**Buttons programming**

[INDENT]Hi all !

I have this specific problem that i don’t have a clue about how to deal with. There could also be many programming possibilities, especially for games. Its a problem involving simple button programing of identicle buttons. say A,B and C. (figure below) As a simple case these buttons are placed on the left side of the frame. What needs to be accomplished is the following button functionality :-

1. when i click on say ball C, it should move to the right side of the frame alone.
2. if i click on ball B with all the balls as shown, then balls B & C should move to the right edge as a group.
3. if i click on ball A with all the balls as shown, then all the balls A,B & C should move to the right edge as a group.
4. For a similar action and similar logic when the balls are on the right edge to move them back to the left edge.

While its a very very simple thing to accomplish for a single button and which i have already done, I am not even sure how this could be done for more than one button when they can be moved singly or in a group & various combinations are possible.

1. Basically it translates to a programming problem which must move all the balls/buttons as a group or a single button, starting with the button clicked on.

I think this is should be interesting for there are many many programming solutions possible but which wud be most efficient?

Personally I have no clue about this so any help , suggestions would be appreciated. Thanks all !

![](http://www.kirupa.com/forum/attachment.php?attachmentid=54247&stc=1)[/INDENT]
