# Assinging values to buttons

**URL:** <https://forum.kirupa.com/t/assinging-values-to-buttons/245454>\
**Category:** flash\
**Created:** [November 29, 2007, 8:52pm UTC](https://forum.kirupa.com/t/assinging-values-to-buttons/245454 "2007-11-29T20:52:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_n00](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@mr\_n00](https://forum.kirupa.com/u/mr_n00)\
**Post date:** [November 29, 2007, 8:52pm UTC](https://forum.kirupa.com/t/assinging-values-to-buttons/245454/1 "2007-11-29T20:52:04Z")

</div>

Hi there,

I have this piece of code:

```auto
bt_mc.addEventListener(MouseEvent.CLICK, onClick);
bt2_mc.addEventListener(MouseEvent.CLICK, onClick2);

function onClick(Event:MouseEvent):void {
    PutOnStage("thumb_dk.swf");
    }
function onClick2(Event:MouseEvent):void {
    PutOnStage("broom_dk.swf");
    }

```

The thing that is crushing my skull is i have 6 buttons in each page and each one of them call a different movie. Is there a better way to call them, i mean, like, assign a value to each button so i dont have to write 6 different versions of the same function on my code?

any help really appreciated,  
mr\_n00
