# \[JSFL\] Remove textfields from stage

**URL:** <https://forum.kirupa.com/t/jsfl-remove-textfields-from-stage/331238>\
**Category:** flash\
**Created:** [June 19, 2013, 1:32am UTC](https://forum.kirupa.com/t/jsfl-remove-textfields-from-stage/331238 "2013-06-19T01:32:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tompa](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@Tompa](https://forum.kirupa.com/u/Tompa)\
**Post date:** [June 19, 2013, 1:32am UTC](https://forum.kirupa.com/t/jsfl-remove-textfields-from-stage/331238/1 "2013-06-19T01:32:08Z")

</div>

I’m looking for a way to remove all textfiends that is directly placed to the stage.  
I do manage to get an array of the textfields, and I can get x, y, text etc. from it,  
but no way I’ve tested so far has worked to target the field and remove it.

This is the code I got at the moment, I’ve tried thousands of ways to make it delete the fields, but the fields persists…

```auto

var textFieldArray = fl.findObjectInDocByType("text", doc);
for (var i=0; i < textFieldArray.length; i++){
    doc.selection[0] = textFieldArray*;
    doc.deleteSelection();
}

```

Output:

```auto
The function deleteSelection() is currently unavailable.

```

_(This means the selection is empty)_

I would really appreciate any help or tips given!

_Thanks in advance,  
Tompa_
