# Button advice

**URL:** <https://forum.kirupa.com/t/button-advice/248164>\
**Category:** flash\
**Created:** [January 4, 2008, 3:15pm UTC](https://forum.kirupa.com/t/button-advice/248164 "2008-01-04T15:15:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![geminione](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@geminione](https://forum.kirupa.com/u/geminione)\
**Post date:** [January 4, 2008, 3:15pm UTC](https://forum.kirupa.com/t/button-advice/248164/1 "2008-01-04T15:15:35Z")

</div>

I’m jumping into AS3 and I am lost yet again. So you no longer can tag actions onto an object??? Anyways. I’m setting up a navigation structure and popup menu. I’d like the buttons to share the same function. I hope this makes sense … it is completely wrong. Basically trying to set this up so I can list my buttons in the array and have them share everything. …

```auto

var buttonArray:Array = [b1, b2, b3]; // this would be my buttons/mc
for (var i: Number = 0; i < buttonArray.length; i++){
	buttonArray.addEventListener(MouseEvent.MOUSE_OVER, over);
	buttonArray.addEventListener(MouseEvent.MOUSE_OUT, out);
	buttonArray.buttonMode = true;
	function over(event:MouseEvent):void {
	showPop(); // function to show menu
}
function out(event:MouseEvent):void {
	hidePop(); // function to hide menu
}
	
}

```

If that is the wrong way to go about this do I need to use this for every clip I want to use as a button?

```auto

b1.addEventListener(MouseEvent.MOUSE_OVER, over);
b1.addEventListener(MouseEvent.MOUSE_OUT, out);
b1.buttonMode = true;

```

Wait, see I just thought of something. Previously I would write this something like this:

```auto

function myButtons(thisInfoFromButton) {
// do stuff here
}

```

Then I’d assign this on the button:

```auto

on(press){
myButtons(thisInfoFromButton);
}

```

If you can’t add actions to objects aren’t you writing a ton more? I am so lost. Thanks.
