 {
 import flash.events.Event;
 import flash.events.KeyboardEvent;
+import flash.events.TextEvent;
 import flash.geom.Rectangle;
 import flash.text.Font;
 import flash.text.TextField;

        }
    }
    
    //--------------------------------------------------------------------------
    //
    //  Variables

    {
        super();
        
        // RichEditableText is double-clickable by default, so we will be too.
        doubleClickEnabled = true;
        
        // Add a high priority change handler so we can capture the event
        // and re-dispatch as a TextOperationEvent
        addEventListener(Event.CHANGE, changeHandler, false, 100);
        
        // Add a textInput handler so we can capture and re-dispatch as
        // a TextOperationEvent "changing" event.
        addEventListener(TextEvent.TEXT_INPUT, textInputHandler);
        
        // Add a key down listener to listen for enter key
        addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
