         _lastSelected = null;
     }
 
+    /**
+     * Handle focusing the text field.
+     */
+    protected static function handleFieldFocus (event :MouseEvent) :void
+    {
+        var tf :TextField = TextField(event.currentTarget);
+        if (tf.stage.focus == tf) {
+            return; // already has focus, bail.
+        }
+
+        // else, assign focus
+        tf.stage.focus = tf;
+
+        // try to be smart and move the cursor near the click
+        if (tf.selectable) {
+            var idx :int = tf.getCharIndexAtPoint(event.localX, event.localY);
+            if (idx != -1) {
+                tf.setSelection(idx, idx);
+            }
+        }
+    }
+
     /** The last tracked TextField to be selected. */
     protected static var _lastSelected :TextField;
 

            tf.defaultTextFormat = createFormat(formatProps);
        }
        updateText(tf, text);

        return tf;
    }


    /**
     * Create a TextField.
     * The field will have setFocusable() called on it.
     * Note that if the autoSize property is not none, then the field will be resized
     * to the size of the text, overwriting any width/height properties specified.
     *
     * @param initProps contains properties with which to initialize the TextField.
     * Additionally it may contain the following properties:
