Characters count only start counting on the 2nd character??

Posted by Hwang on Stack Overflow See other posts from Stack Overflow or by Hwang
Published on 2010-03-19T02:43:38Z Indexed on 2010/03/19 2:51 UTC
Read the original article Hit count: 252

I have a function that calculates how many characters remaining the user can type, but I don't know why it only starts counting from the 2nd characters. Means at the end I will able to type an extra character from the maximum amount I set.

wInput.maxChars=30

wInput.addEventListener(KeyboardEvent.KEY_DOWN, calculate);
private function calculate(event:Event=null):void {
                NameRC=wInput.maxChars-wInput.length;
                remainingA.text=NameRC;

        }

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about keyboard-events