# Textfield resetting.. probably newbie problem

**URL:** <https://forum.kirupa.com/t/textfield-resetting-probably-newbie-problem/290497>\
**Category:** flash\
**Created:** [June 15, 2009, 9:09pm UTC](https://forum.kirupa.com/t/textfield-resetting-probably-newbie-problem/290497 "2009-06-15T21:09:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dingo](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@dingo](https://forum.kirupa.com/u/dingo)\
**Post date:** [June 15, 2009, 9:09pm UTC](https://forum.kirupa.com/t/textfield-resetting-probably-newbie-problem/290497/1 "2009-06-15T21:09:28Z")

</div>

E- appears to be a problem with masking text. Trying to embed it now…

Howdy.

So, I have a button that I want to display a label movieclip on mouseover, yeah? -and the clip contains a blank dynamic textField with an instance name of “label\_text”. So, I have one of these clips as a private variable in the button’s class definition, and the constructor passes the button’s instance name to the label’s constructor to set the text field. Unfortunately, the text will only show if I actually open up the label’s clip in the library and type something in. Not very dynamic! What’s the deal?

The button’s class:

```auto
public class BlueButton extends MovieClip {
        
        private var button_text:String; 
        private var buttonLabel:LabelClip;
        
        public function BlueButton() {
            button_text = this.name;
            buttonLabel = new LabelClip(button_text);
            this.addEventListener(MouseEvent.MOUSE_OVER, showLabel);
        }
        
        private function showLabel(e:MouseEvent):void {
            e.target.removeEventListener(MouseEvent.MOUSE_OVER, showLabel);
            e.target.addEventListener(MouseEvent.MOUSE_OUT, hideLabel);
            e.target.addChild(buttonLabel);
            e.target.buttonLabel.gotoAndPlay(1);
        }
        
        private function hideLabel(e:MouseEvent):void {
            e.target.removeEventListener(MouseEvent.MOUSE_OUT, hideLabel);
            e.target.addEventListener(MouseEvent.MOUSE_OVER, showLabel);
            e.target.removeChild(buttonLabel);
        }
    
    }

```

the label’s class:

```auto
public class LabelClip extends MovieClip {
        
        public function LabelClip(txt:String):void {
            label_text.appendText(txt);
        }
    }

```
