 
         // if there was no error, clear the entry area in prep for the next entry event
         _txt.text = "";
+        _histidx = -1;
+    }
+
+    protected function scrollHistory (next :Boolean) :void
+    {
+        var size :int = _chatDtr.getCommandHistorySize();
+        if ((_histidx == -1) || (_histidx == size)) {
+            _curLine = _txt.text;
+            _histidx = size;
+        }
+
+        _histidx = (next) ? Math.min(_histidx + 1, size)
+                          : Math.max(_histidx - 1, 0);
+        var text :String = (_histidx == size) ? _curLine : _chatDtr.getCommandHistory(_histidx);
+        _txt.text = text;
+        _txt.setSelection(text.length, text.length);
     }
 
     /**


    /** The place where the user may enter chat. */
    protected var _txt :ChatInput;

    /** The button for sending chat. */
    protected var _but :CommandButton;


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

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