# Changing opacity of a row of buttons with the click of another button

**URL:** https://forum.kirupa.com/t/changing-opacity-of-a-row-of-buttons-with-the-click-of-another-button/287716
**Category:** Uncategorized
**Created:** [May 5, 2009, 2:58pm UTC](https://forum.kirupa.com/t/changing-opacity-of-a-row-of-buttons-with-the-click-of-another-button/287716 "2009-05-05T14:58:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![webguync](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/webguync/32/2434_2.png) [@webguync](https://forum.kirupa.com/u/webguync)
#### Post date: [May 5, 2009, 2:58pm UTC](https://forum.kirupa.com/t/changing-opacity-of-a-row-of-buttons-with-the-click-of-another-button/287716/1 "2009-05-05T14:58:00Z")

</div>

Hi,

I have created a button with an instance name of ‘ClickMe’ and also five buttons each with thier own instance name (B1-B5). I want to change their opacity to zero onclick preferably as a tween from where they are now in opacity (100%) to the zero. I need some assistance with this.

I know it involves importing classes and creating a function. I also believe I can control the set of 5 buttons with iteration.

```auto

ClickMe.onPress = function() {
    
    for (var i=1; i<=5; i++) {
        ['B1_'+i].changeopacity = MyMC!['B1_'+i].changeback;
    }

```

I know this isn’t how to do it, but is something along the lines of what I need.
