 
     /** The place where the user may enter chat. */
     protected var _txt :ChatInput;
+
+    /** The current index in the chat command history. */
+    protected var _histidx :int = -1;
 
     /** The button for sending chat. */
     protected var _but :CommandButton;


        addChild(_txt = new ChatInput());
        _txt.addEventListener(FlexEvent.ENTER, sendChat, false, 0, true);

        _but = new CommandButton(sendButtonLabel, sendChat);
        addChild(_but);

        if (event.type == Event.ADDED_TO_STAGE) {
            // set up any already-configured text
            _txt.text = _curLine;
            _histidx = -1;

            // request focus
            callLater(_txt.setFocus);
