# Applying one function to many buttons?

**URL:** https://forum.kirupa.com/t/applying-one-function-to-many-buttons/297607
**Category:** Uncategorized
**Created:** [October 5, 2009, 11:49pm UTC](https://forum.kirupa.com/t/applying-one-function-to-many-buttons/297607 "2009-10-05T23:49:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![geestring](https://avatars.discourse-cdn.com/v4/letter/g/e19b73/32.png) [@geestring](https://forum.kirupa.com/u/geestring)
#### Post date: [October 5, 2009, 11:49pm UTC](https://forum.kirupa.com/t/applying-one-function-to-many-buttons/297607/1 "2009-10-05T23:49:49Z")

</div>

function clicked(e:MouseEvent):void {

```
if(a == 0){
   Tweener.addTween(circle, {scaleX:5, scaleY:5, time:0.5, transition:"easeOutElastic"});
   Tweener.addTween(circle, {x:middleX, y:middleY, time:0.5, transition:"easeInOutBounce"});
   a = 1;
}else if(a == 1){
   Tweener.addTween(circle, {scaleX:1, scaleY:1, time:0.5, transition:"easeOutElastic"});
       Tweener.addTween(circle, {x: origX, y: origY, time:0.5, transition:"easeInOutBounce"});
       a = 0;
}

```

}

circle.addEventListener(MouseEvent.CLICK, clicked);

the addEventListener will be in a forloop and applied to all the circles that are created. But how do I have the function apply itself to all the circle(s)

How do I send an “circle” array as an argument or whatever it’s called to that clicked function.
