# How to place text field inside a movie clip using as3

**URL:** https://forum.kirupa.com/t/how-to-place-text-field-inside-a-movie-clip-using-as3/325338
**Category:** flash
**Created:** [October 10, 2011, 10:39am UTC](https://forum.kirupa.com/t/how-to-place-text-field-inside-a-movie-clip-using-as3/325338 "2011-10-10T10:39:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mangalasseri](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@mangalasseri](https://forum.kirupa.com/u/mangalasseri)
#### Post date: [October 10, 2011, 10:39am UTC](https://forum.kirupa.com/t/how-to-place-text-field-inside-a-movie-clip-using-as3/325338/1 "2011-10-10T10:39:10Z")

</div>

[LEFT][COLOR=#333333][FONT=Arial]I have created two text boxes one is source and another is output. I want to place the output box inside a movie clip so that i can move it. How can i place the output text box inside a movie clip ?

code is bellow,

package  
{  
import flash.display.Sprite;  
import flash.display.Stage;  
import flash.text._;  
import flash.events._;

```
public class CaptureUserInput extends Sprite
{
    private var myTextBox:TextField = new TextField();
    private var myOutputBox:TextField = new TextField();
    private var myText:String = "Type your text here.";

    public function CaptureUserInput()
    {
        captureText();
    }
    
    public function captureText():void
    {
        myTextBox.type = TextFieldType.INPUT;
        myTextBox.background = true;
        addChild(myTextBox);
        myTextBox.text = myText;
        myTextBox.addEventListener(TextEvent.TEXT_INPUT, textInputCapture);
    }
    
    public function textInputCapture(event:TextEvent):void
    {
        var str:String = myTextBox.text;
        createOutputBox(str);
    }
        
    public function createOutputBox(str:String):void
    {
        myOutputBox.background = true;
        myOutputBox.x = 200;
        addChild(myOutputBox);
        myOutputBox.text = str;
    }
    
}

```

}

[/FONT][/COLOR][/LEFT]
