# How do I target multiple buttons

**URL:** <https://forum.kirupa.com/t/how-do-i-target-multiple-buttons/196240>\
**Category:** flash\
**Created:** [August 6, 2006, 7:30am UTC](https://forum.kirupa.com/t/how-do-i-target-multiple-buttons/196240 "2006-08-06T07:30:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen123](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@Allen123](https://forum.kirupa.com/u/Allen123)\
**Post date:** [August 6, 2006, 7:30am UTC](https://forum.kirupa.com/t/how-do-i-target-multiple-buttons/196240/1 "2006-08-06T07:30:40Z")

</div>

```auto

for(var i:Number = 0; i < 3; i++) {
var mc:MovieClip = this.attachMovie("myButton", "myButton" + i, i);
mc.index = i;
mc.onPress = function():Void {
trace(this.index);
//current selected _alpha=50. how to control other buttons _alpha at the sametime.
this._alpha =50;
}
}

```

I have a question about the code.  
Now. I can contorl the current selected mc.like myButton1.But How I can control the other button action at the sametime.like myButton1.\_alpha =50, myButton2,myButton3,myButton4…\_alpha = 30.

thanks a lot!
