# Linking code to simple button/textbox within mc

**URL:** https://forum.kirupa.com/t/linking-code-to-simple-button-textbox-within-mc/275818
**Category:** flash
**Created:** [November 19, 2008, 12:22am UTC](https://forum.kirupa.com/t/linking-code-to-simple-button-textbox-within-mc/275818 "2008-11-19T00:22:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Hausnfranz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hausnfranz/32/2427_2.png) [@Hausnfranz](https://forum.kirupa.com/u/Hausnfranz)
#### Post date: [November 19, 2008, 12:22am UTC](https://forum.kirupa.com/t/linking-code-to-simple-button-textbox-within-mc/275818/1 "2008-11-19T00:22:21Z")

</div>

Hey all,

Attached is a file with a simple flash button within an mc. I am having trouble linking the code on the root timeline to a textbox within an mc that changes depending on what is happening to the button.

Anyone have an idea of why it’s not working?

```auto
stop();

this.tutButton.txtBox.text = "Up"
this.tutButton.exampleBtn.onRollOver = function() {
    this.tutButton.exampleBtn.txtBox.text = "Over"
}
this.tutButton.exampleBtn.onPress = function() {
    this.tutButton.exampleBtn.txtBox.text = "Down"
}
this.tutButton.exampleBtn.onRollOut = function() {
    this.tutButton.exampleBtn.txtBox.text = "Up"
}

```
