# Pass actionscript code through variable (dynamic buttons)

**URL:** <https://forum.kirupa.com/t/pass-actionscript-code-through-variable-dynamic-buttons/141499>\
**Category:** Uncategorized\
**Created:** [March 20, 2005, 8:16pm UTC](https://forum.kirupa.com/t/pass-actionscript-code-through-variable-dynamic-buttons/141499 "2005-03-20T20:16:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![polishbroadcast](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@polishbroadcast](https://forum.kirupa.com/u/polishbroadcast)\
**Post date:** [March 20, 2005, 8:16pm UTC](https://forum.kirupa.com/t/pass-actionscript-code-through-variable-dynamic-buttons/141499/1 "2005-03-20T20:16:39Z")

</div>

i have some dynamic MC buttons which are working great but i want to basically inject what the onrelease code is for each button usng on onLoad command. Right now onLoad sends the button label and i would like to send the actionscript code as well.

On the MC that holds the button the onLoad passes

```auto
this.label = "button label";

```

correctly.

```auto
command = 'trace("osaka!");'

```

passes that info to

```auto
on(release) {
	command
	}

```

inside, but it treats it as text and not code. So how can i pass actionscript commands so they fill in the variables inside the button?

Thanks.
