# Detect any Button press

**URL:** https://forum.kirupa.com/t/detect-any-button-press/319875
**Category:** flash
**Created:** [March 7, 2011, 4:25pm UTC](https://forum.kirupa.com/t/detect-any-button-press/319875 "2011-03-07T16:25:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![daush](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@daush](https://forum.kirupa.com/u/daush)
#### Post date: [March 7, 2011, 4:25pm UTC](https://forum.kirupa.com/t/detect-any-button-press/319875/1 "2011-03-07T16:25:42Z")

</div>

Hi there.

Can someone helpme on this.

i have 10 buttons on stage. bt01,bt02,bt03…  
for every button in my code i have bt01.onPress = function()  
all buttons call the same function: animation(this);

How can i detect any button pressed? i dont want to use bt01.onPress. etc etc. etc… they are not Dynamic.

something like buttons.prototype.onPressed = function(){animation(this)}

or a for…i tryied for but it only work with dynamic buttons.

help please 😃
