# Function param same as button click

**URL:** <https://forum.kirupa.com/t/function-param-same-as-button-click/234618>\
**Category:** Uncategorized\
**Created:** [August 3, 2007, 7:38pm UTC](https://forum.kirupa.com/t/function-param-same-as-button-click/234618 "2007-08-03T19:38:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GrndMasterFlash](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@GrndMasterFlash](https://forum.kirupa.com/u/GrndMasterFlash)\
**Post date:** [August 3, 2007, 7:38pm UTC](https://forum.kirupa.com/t/function-param-same-as-button-click/234618/1 "2007-08-03T19:38:01Z")

</div>

i need to some how make the function.call(param) the name of the button you press to call it.

that is to say if you press bh01 then the call would be vistoggle(bh01)

any thought or ideas would be greatly appreciated

```auto
import flash.display.*;
import flash.events.*;
import flash.ui.Keyboard;

function clickbh01(event:MouseEvent) {
    vistoggle(player.h01);
    trace(this);
}

player.h01.alpha = .0;
player.h02.alpha = .0;
player.n01.alpha = .0;
player.gotoAndStop(1);

bh01.addEventListener(MouseEvent.MOUSE_DOWN, clickbh01);

function vistoggle(item:Object) {

    if (item.alpha == .0) {
        item.alpha = 1;
    } else {
        if (item.alpha == 1) {
            item.alpha = 0;
        }
    }
}

```

any ideas:panda:
