# Er... TextField.appendText() is counting wrong?

**URL:** <https://forum.kirupa.com/t/er-textfield-appendtext-is-counting-wrong/254295>\
**Category:** flash\
**Created:** [March 10, 2008, 5:45pm UTC](https://forum.kirupa.com/t/er-textfield-appendtext-is-counting-wrong/254295 "2008-03-10T17:45:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Battie](https://avatars.discourse-cdn.com/v4/letter/b/ba9def/32.png) [@Battie](https://forum.kirupa.com/u/Battie)\
**Post date:** [March 10, 2008, 5:45pm UTC](https://forum.kirupa.com/t/er-textfield-appendtext-is-counting-wrong/254295/1 "2008-03-10T17:45:32Z")

</div>

It’s gotta be me, but I just can’t figure out what’s wrong here. I would assume that appendText() adds text right after the character at textField.length, but instead it’s putting it right before.

Code:

```auto
function pullText(Event:MouseEvent){
    toProcess = enterField.text;
    enterField.text = "";
    putText();
}

function putText(){
    complField.appendText(toProcess);
    toProcess = "";
}

```

If I type “test” in enterField and click the button, it correctly appears in complField. However, if I type “ab” in enterField, complField shows “tesabt”. Huh?

I can’t see what I’m doing wrong, especially since if I just use += everything displays correctly (but the compiler claims it’s much slower). Then again, I’m an AS3 newbie.

Thank you for your help!

(By the way, I do plan to put "  
" at the end of each append to make things display more neatly. But if I do that in the test it’s not as easy to see the error.)
