# AS3 - Movieclip linkage question

**URL:** <https://forum.kirupa.com/t/as3-movieclip-linkage-question/208810>\
**Category:** Uncategorized\
**Created:** [December 2, 2006, 11:04pm UTC](https://forum.kirupa.com/t/as3-movieclip-linkage-question/208810 "2006-12-02T23:04:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fingers](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@Fingers](https://forum.kirupa.com/u/Fingers)\
**Post date:** [December 2, 2006, 11:04pm UTC](https://forum.kirupa.com/t/as3-movieclip-linkage-question/208810/1 "2006-12-02T23:04:59Z")

</div>

In my library I have a movieclip that is linked to my AS3 custom class TweenButton. On the movieclip there is a textfield. I would like to be able to set the .text property of the textfield through TweenButton’s constructor, which must be so simple, but I haven’t been able to make it work. If someone could please explain it all to me slow and easy, I would be most gratefull. 🙂 Here’s the code and source files:

```auto

package
{
    import flash.display.*;
    import TweenButton;
    
    public class Base extends MovieClip {
        
        private var __myFirstButton:TweenButton;
        private var __mySecondButton:TweenButton;
        private var __myThirdButton:TweenButton;
        private var __myFourthButton:TweenButton;
        
        public function Base() {
            var myFirstButton:TweenButton = new TweenButton(150, 150);
            __myFirstButton = myFirstButton;

            
            var mySecondButton:TweenButton = new TweenButton(150, 190);
            __mySecondButton = mySecondButton;
    
            
            var myThirdButton:TweenButton = new TweenButton(150, 230);
            __myThirdButton = myThirdButton;
        
            
            var myFourthButton:TweenButton = new TweenButton(150, 270);
            __myFourthButton = myFourthButton;
    

            addChild(myFirstButton);
            addChild(mySecondButton);
            addChild(myThirdButton);
            addChild(myFourthButton);
        }
    }
}

```

```auto

package
{
    import flash.display.*;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.events.*
    
    public class TweenButton extends MovieClip {
        
        private var __over:Boolean;

        public function TweenButton(posX:Number, posY:Number) {
            
            this.x = posX;
            this.y = posY;
            
            __over = new Boolean();
            __over = undefined;
            
            this.addEventListener(MouseEvent.MOUSE_OVER,overHandler);
            this.addEventListener(MouseEvent.MOUSE_OUT,outHandler);
            }
        
        public function overHandler(e:MouseEvent):void {
            __over = true;
            this.addEventListener(Event.ENTER_FRAME,playForwards);
            }
        
        public function outHandler(e:MouseEvent):void {
            __over = false;
            this.addEventListener(Event.ENTER_FRAME,playBackwards);
            }
                    
        public function playForwards(e:Event):void {
            if(__over == true){
                this.nextFrame();
                }
            }
        
        public function playBackwards(e:Event):void {
            if(__over == false){
                this.prevFrame();
            
                }
        }
    }
}

```

Fingers
