# Static buttons, dynamic actions?

**URL:** https://forum.kirupa.com/t/static-buttons-dynamic-actions/136350
**Category:** Uncategorized
**Created:** [February 3, 2005, 11:13pm UTC](https://forum.kirupa.com/t/static-buttons-dynamic-actions/136350 "2005-02-03T23:13:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![macneilslt](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@macneilslt](https://forum.kirupa.com/u/macneilslt)
#### Post date: [February 3, 2005, 11:13pm UTC](https://forum.kirupa.com/t/static-buttons-dynamic-actions/136350/1 "2005-02-03T23:13:04Z")

</div>

Okay, I have 10 buttons named b0, b1, b2…b9 on the main timeline. In the first frame I have this AS:

```auto

getButtons = function () {
	for (i=0; i<=9; i++) {
		but = "b"+i;
	}
	but.onPress = function() {
		trace(this._name);
	};
};

```

Why doesn’t this work?
