# Deleting / removing objects like buttons and textboxes using actionscript 2.0

**URL:** <https://forum.kirupa.com/t/deleting-removing-objects-like-buttons-and-textboxes-using-actionscript-2-0/329651>\
**Category:** Uncategorized\
**Created:** [September 27, 2012, 7:37am UTC](https://forum.kirupa.com/t/deleting-removing-objects-like-buttons-and-textboxes-using-actionscript-2-0/329651 "2012-09-27T07:37:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajoo](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@ajoo](https://forum.kirupa.com/u/ajoo)\
**Post date:** [September 27, 2012, 7:37am UTC](https://forum.kirupa.com/t/deleting-removing-objects-like-buttons-and-textboxes-using-actionscript-2-0/329651/1 "2012-09-27T07:37:04Z")

</div>

Hi all !

I made a small program attached for your convenience. Frame 1 creates text boxes using actionscript. Frame 2 to frame 19 has a simple welcome color / motion tween. After frame 1 executes the code I want to delete the text boxes or any other object on screen before the tween begins on frame 2 to frame 19. The method I tried , using removeTextField, does not seem to work. Can anyone help me with this and also suggest if this could be done in a better and more efficient manner.

Thanks for any help.

The code for those who won’t wanna download a file.

```auto
stop();for(var i=0; i<6; i++)
{
  //create textfield in one column, can adjust the width and height
  //again after text been input in
    _root.createTextField("textfield"+i, i, 30, i*30+25, 50, 30);
      _root["textfield"+i].border = true;
// _root["textfield"+i].align = "right";
      _root["textfield"+i].text = i*2;
    
    var sans:TextFormat = new TextFormat();
    sans.size = 12;
    sans.font = "Arial";
    sans.align = "right" ;
// sans.size = 18;
    align.font = "New Courier";
    _root["textfield"+i].setTextFormat(sans);
};

function Moveon(){
    clearInterval(MoveID);
        for(var i=0; i<6; i++){
            _root["textfield"+i].removeTextField;
        }
    }

MoveID = setInterval ("Moveon", 5000);

    

```
