# Selection problem?

**URL:** <https://forum.kirupa.com/t/selection-problem/65395>\
**Category:** Uncategorized\
**Created:** [September 25, 2004, 9:52pm UTC](https://forum.kirupa.com/t/selection-problem/65395 "2004-09-25T21:52:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![2nd\_day](https://avatars.discourse-cdn.com/v4/letter/2/a4c791/32.png) [@2nd\_day](https://forum.kirupa.com/u/2nd_day)\
**Post date:** [September 25, 2004, 9:52pm UTC](https://forum.kirupa.com/t/selection-problem/65395/1 "2004-09-25T21:52:43Z")

</div>

i want to know if the next thing is possible, and if it is… how should i do it.

i’ve got a menu with 4 buttons. if you click one i want to do something with other 3, and do something else with the clicked button… its kinda like the navigation on this website [www.green-lizard.com](http://www.green-lizard.com)

can somebody help me?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 26, 2004, 1:58am UTC](https://forum.kirupa.com/t/selection-problem/65395/2 "2004-09-26T01:58:35Z")

</div>

have you tried it becuase thats a large problem to explain? i mean theres multiple parts to it, but i believe looking at the file size for the loading that they just used movieclips, i could be wrong though.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 26, 2004, 7:35am UTC](https://forum.kirupa.com/t/selection-problem/65395/3 "2004-09-26T07:35:24Z")

</div>

You can do this using a couple of arrays  
//mc with linkage mc + dynamic textfield instance myText.  
var acceleration = 12;  
var friction = 0.8;  
clipArray = [];  
posArray = [];  
for (var k = 0; k\<6; k++) {  
myclip = attachMovie(“mc”, “mc”+k, k);  
myclip.\_y = 300;  
myclip.\_x = 50+myclip.\_width\*k;  
myclip.myText.text = "Button “+k;  
clipArray.push(myclip);  
countArray.push(k);  
posArray.push(myclip.\_x);  
myclip.onPress = dostuff;  
}  
function move() {  
var xdif = posArray[this.jvar]-this.\_x;  
this.xspeed += xdif/this.\_parent.acceleration;  
this.xspeed _= this.\_parent.friction;  
this.\_x += this.xspeed;  
this.checkDistance();  
}  
checkDistance = function () {  
if (Math.abs(posArray[this.jvar]-this.\_x)\<1) {  
this.\_x = posArray[this.jvar];  
delete this.onEnterFrame;  
}  
};  
function dostuff() {  
for (var i = 0; i\<clipArray.length; i++) {  
clipArray_.ivar = i;  
}  
k = clipArray.splice(this.ivar, 1);  
clipArray = k.concat(clipArray);  
for (var j = 0; j\<posArray.length; j++) {  
clipArray[j].jvar = j;  
trace(clipArray[j]+” "+clipArray[j].jvar);  
clipArray[j].onEnterFrame = move;  
}  
}

[http://www.gifsrus.com/testfile/swingbuttons.swf](http://www.gifsrus.com/testfile/swingbuttons.swf)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 26, 2004, 9:28am UTC](https://forum.kirupa.com/t/selection-problem/65395/4 "2004-09-26T09:28:24Z")

</div>

yeah this will help… but i cant get it working… it won’t move… it does trace the right position but it won’t move. Maybe you can send me the .fla? Thanks a lot!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 26, 2004, 9:53am UTC](https://forum.kirupa.com/t/selection-problem/65395/5 "2004-09-26T09:53:00Z")

</div>

> [@2nd day](#):
>
> yeah this will help… but i cant get it working… it won’t move… it does trace the right position but it won’t move. Maybe you can send me the .fla? Thanks a lot!

if you are using 2004 check that all my variables are the same case-i am careless.  
You don`t need the line countArray.push(k); Just something i was playing with + forgot to delete.
