# Button problem

**URL:** <https://forum.kirupa.com/t/button-problem/13243>\
**Category:** Uncategorized\
**Created:** [February 10, 2003, 6:48pm UTC](https://forum.kirupa.com/t/button-problem/13243 "2003-02-10T18:48:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![scrat](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@scrat](https://forum.kirupa.com/u/scrat)\
**Post date:** [February 10, 2003, 6:48pm UTC](https://forum.kirupa.com/t/button-problem/13243/1 "2003-02-10T18:48:40Z")

</div>

I made a row of buttons in flash… the meaning is that when I click on a button that button stays highlighted.  
So I mad an mc (MC\_inl) with inthere a button that stays highlighted.

in my row I put the following

on (release) {  
getURL(“home\_nl\_inh.htm”, “HomeNlMainFrame”);  
\_root.pagina = “1”;  
if (\_root.pagina==1) {  
MC\_inl.\_visible=true;  
MC\_inl.\_x=143.9;  
MC\_inl.\_y=29.5;  
} else {  
MC\_inl.\_visible=false;  
}  
}

but it doesn’t work  
what am I doing wrong??

---

<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:** [February 10, 2003, 8:41pm UTC](https://forum.kirupa.com/t/button-problem/13243/2 "2003-02-10T20:41:20Z")

</div>

try adding…  
\_root.MC\_inl.\_visible=true;  
before all mc names

/sput

---

<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:** [February 13, 2003, 4:16pm UTC](https://forum.kirupa.com/t/button-problem/13243/3 "2003-02-13T16:16:48Z")

</div>

sorry does not work…

:hangover:

---

<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:** [February 13, 2003, 4:58pm UTC](https://forum.kirupa.com/t/button-problem/13243/4 "2003-02-13T16:58:06Z")

</div>

Maybe I’m missing something…

Why dont you just change the color of the button onRelease?

When you click on one button, it resets the color of all other buttons and changes THAT button to the desired, highlighted, color.

Isn’t that what you’re trying to accomplish?

---

<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:** [February 13, 2003, 5:35pm UTC](https://forum.kirupa.com/t/button-problem/13243/5 "2003-02-13T17:35:19Z")

</div>

post the fla.

/sput

---

<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:** [February 14, 2003, 10:50am UTC](https://forum.kirupa.com/t/button-problem/13243/6 "2003-02-14T10:50:06Z")

</div>

when I give the button an other collor onrelease, and I click on an other button… the previous button I clicked stays highlighted in that collor… thats not what I want

thx for trying

---

<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:** [February 14, 2003, 8:53pm UTC](https://forum.kirupa.com/t/button-problem/13243/7 "2003-02-14T20:53:43Z")

</div>

since you didnt post your fla, I’ll give you the basics, this is a simple way of doing it. You could go and do prototypes and functions and such, but I find that if you’re learning, this is a good way to practice your logic.

When you sit down to do your script, just sound it out in plain english. Write it down… kind of like this:

This is what I want:

All my buttons are blue.

When I click on one of the buttons

I want my blue button to turn light blue (highlight).

When I click on a different button,

I want all buttons to return to dark blue

and have the new button turn light blue.

…take those words and think out your script.

onRelease(){ when I click on one of the buttons

you can swap colors or change the rgb.

you will need button states or you will need to change each button. For example,

(oh, Im not going to give you actual code, since you made it hard on me 🙂 )

onRelease(){  
this.button.color=highlight  
button1.color=normal  
button2.color=normal  
button4.color=normal.

if you click on button 1,

onRelease(){  
this.button.color=highlight  
button2.color=normal  
button3.color=normal  
button4.color=normal

etc…

give that shot!
