     
     private function stageText_changeHandler(event:Event):void
     {
-        if (stageText != null)
-            _text = stageText.text;
-        dispatchEvent(new TextOperationEvent(event.type));
+        var foundChange:Boolean = false;
+        var foundEnter:Boolean = false;
+        
+        if (stageText != null)
+        {
+            var oldText:String = _text;
+            var oldLength:int = oldText.length;
+            var newText:String = stageText.text;
+            var newLength:int = newText.length;
+                
+            if (!_multiline && newText.substr(0, oldLength) == oldText)
+            {
+                // This is a single-line text field, so the enter key should
+                // dispatch an enter event instead of inserting a newline
+                // character. StageText does not dispatch a key-down event for
+                // us to use to intercept the enter key, so our only choice
+                // right now is to trap it here, after the field's text has 
+                // changed.
+                
+                if (oldLength == newLength - 1)
+                {
+                    var lastChar:String = newText.substr(oldLength, 1);
+                    foundEnter = lastChar == "\r" || lastChar == "\n";
+                }
+                else if (oldLength == newLength - 2)
+                {
+                    var tail:String = newText.substr(oldLength, 2);
+                    foundEnter = tail == "\r\n" || tail == "\n\r";
+                }
+            }
+
+            if (foundEnter)
+            {
+                foundChange = true;
+                stageText.text = _text;
+            }
+            else
+            {
+                foundChange = newText != oldText;
+                _text = stageText.text;
+            }
+        }
+
+        if (foundEnter)
+            dispatchEvent(new FlexEvent(FlexEvent.ENTER));
+        
+        if (foundChange)
+            dispatchEvent(new TextOperationEvent(event.type));
     }
     
     private function stageText_focusInHandler(event:FocusEvent):void

import flash.geom.Rectangle;
import flash.geom.Vector3D;
import flash.system.Capabilities;
import flash.text.SoftKeyboardType;
import flash.text.StageText;
import flash.text.StageTextInitOptions;

import mx.core.UIComponent;
import mx.core.UITextFormat;
import mx.core.mx_internal;
import mx.events.FlexEvent;
import mx.geom.TransformOffsets;
import mx.managers.FocusManager;
import mx.styles.CSSStyleDeclaration;
