 import flash.events.KeyboardEvent;
 import flash.events.TextEvent;
 import flash.geom.Matrix;
+import flash.geom.Matrix3D;
 import flash.geom.Point;
+import flash.geom.Vector3D;
 import flash.text.Font;
 import flash.text.TextField;
 import flash.text.TextFieldType;

    {
        setSelection(0, length);
    }
     
    /**
     *  Set focus to this text field.
     * 

    
    //--------------------------------------------------------------------------
    //
    //  IVisualElement implementation
    //
    //--------------------------------------------------------------------------
    
    /**
     * @private
     */
    public function getBoundsXAtSize(width:Number, height:Number, postLayoutTransform:Boolean=true):Number
    {
        return x;
    }
    
    /**
     * @private
     */
    public function getBoundsYAtSize(width:Number, height:Number, postLayoutTransform:Boolean=true):Number
    {
        return y;
    }
    
    /**
     * @private
     */
    public function getLayoutBoundsHeight(postLayoutTransform:Boolean=true):Number
    {
        return height;
    }
    
    /**
     * @private
     */
    public function getLayoutBoundsWidth(postLayoutTransform:Boolean=true):Number
    {
        return width;
    }
    
    /**
     * @private
     */
    public function getLayoutBoundsX(postLayoutTransform:Boolean=true):Number
    {
        return x;
    }
    
    /**
     * @private
     */
    public function getLayoutBoundsY(postLayoutTransform:Boolean=true):Number
    {
        return y;
    }
    
    /**
     * @private
     */
    public function getLayoutMatrix():Matrix
    {
        return transform.matrix;
    }
    
    /**
     * @private
     */
    public function getLayoutMatrix3D():Matrix3D
    {
        return transform.matrix3D;
    }
    
    /**
     * @private
     */
    public function getMaxBoundsHeight(postLayoutTransform:Boolean=true):Number
    {
        return UIComponent.DEFAULT_MAX_WIDTH;
    }
    
    /**
     * @private
     */
    public function getMaxBoundsWidth(postLayoutTransform:Boolean=true):Number
    {
        return UIComponent.DEFAULT_MAX_WIDTH;
    }
    
    /**
     * @private
     */
    public function getMinBoundsHeight(postLayoutTransform:Boolean=true):Number
    {
        return 0;
    }
    
    /**
     * @private
     */
    public function getMinBoundsWidth(postLayoutTransform:Boolean=true):Number
    {
        return 0;
    }
    
    /**
     * @private
     */
    public function getPreferredBoundsHeight(postLayoutTransform:Boolean=true):Number
    {
        return measuredTextSize.y;
    }
    
    /**
     * @private
     */
    public function getPreferredBoundsWidth(postLayoutTransform:Boolean=true):Number
    {
        return measuredTextSize.x;
    }
    
    /**
     * @private
     */
    public function invalidateLayoutDirection():void
    {
        // do nothing
    }
    
    /**
     * @private
     */
    public function setEstimatedSize(estimatedWidth:Number=NaN, estimatedHeight:Number=NaN, invalidateSize:Boolean=true):void
    {
        // TODO (jasonsj)
    }
    
    /**
     * @private
     */
    public function setLayoutBoundsPosition(x:Number, y:Number, postLayoutTransform:Boolean=true):void
    {
        this.x = x;
        this.y = y;
    }
    
    /**
     * @private
     */
    public function setLayoutBoundsSize(width:Number, height:Number, postLayoutTransform:Boolean=true):void
    {
        this.width = width;
        this.height = height;
    }
    
    /**
     * @private
     */
    public function setLayoutMatrix(value:Matrix, invalidateLayout:Boolean):void
    {
        // do nothing
    }
    
    /**
     * @private
     */
    public function setLayoutMatrix3D(value:Matrix3D, invalidateLayout:Boolean):void
    {
        // do nothing
    }
    
    /**
     * @private
     */
    public function transformAround(transformCenter:Vector3D, scale:Vector3D=null, rotation:Vector3D=null, translation:Vector3D=null, postLayoutScale:Vector3D=null, postLayoutRotation:Vector3D=null, postLayoutTranslation:Vector3D=null, invalidateLayout:Boolean=true):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  layoutDirection
    //----------------------------------
    
    /**
     * @private
     */
    public function get layoutDirection():String
    {
        return null;
    }
    
    /**
     * @private
     */
    public function set layoutDirection(value:String):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  baseline
    //----------------------------------
    
    /**
     * @private
     */
    public function get baseline():Object
    {
        return null;
    }
    
    /**
     * @private
     */
    public function set baseline(value:Object):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  baselinePosition
    //----------------------------------
    
    /**
     * @private
     */
    public function get baselinePosition():Number
    {
        commitStyles();
        
        if (invalidateBaselinePosition)
        {
            // getLineMetrics() returns strange numbers for an empty string,
            // so instead we get the metrics for a non-empty string.
            var isEmpty:Boolean = (text == "");
            if (isEmpty)
                super.text = "Wj";
            
            _baselinePosition = getLineMetrics(0).ascent;
            
            if (isEmpty)
                super.text = "";
            
            // baseline = add top gutter
            _baselinePosition += (StyleableTextField.TEXT_HEIGHT_PADDING / 2)
            
            invalidateBaselinePosition = false;
        }
        
        return _baselinePosition;
    }
    
    //----------------------------------
    //  bottom
    //----------------------------------
    
    /**
     * @private
     */
    public function get bottom():Object
    {
        return null;
    }
    
    /**
     * @private
     */
    public function set bottom(value:Object):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  estimatedHeight
    //----------------------------------
    
    /**
     * @private
     */
    public function get estimatedHeight():Number
    {
        return NaN;
    }
    
    //----------------------------------
    //  estimatedWidth
    //----------------------------------
    
    /**
     * @private
     */
    public function get estimatedWidth():Number
    {
        return NaN;
    }
    
    //----------------------------------
    //  hasLayoutMatrix3D
    //----------------------------------
    
    /**
     * @private
     */
    public function get hasLayoutMatrix3D():Boolean
    {
        return false;
    }
    
    //----------------------------------
    //  horizontalCenter
    //----------------------------------
    
    /**
     * @private
     */
    public function get horizontalCenter():Object
    {
        return null;
    }
    
    /**
     * @private
     */
    public function set horizontalCenter(value:Object):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  includeInLayout
    //----------------------------------
    
    /**
     * @private
     */
    public function get includeInLayout():Boolean
    {
        return true;
    }
    
    /**
     * @private
     */
    public function set includeInLayout(value:Boolean):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  left
    //----------------------------------
    
    /**
     * @private
     */
    public function get left():Object
    {
        return null;
    }
    
    /**
     * @private
     */
    public function set left(value:Object):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  percentHeight
    //----------------------------------
    
    /**
     * @private
     */
    public function get percentHeight():Number
    {
        return NaN;
    }
    
    /**
     * @private
     */
    public function set percentHeight(value:Number):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  percentWidth
    //----------------------------------
    
    /**
     * @private
     */
    public function get percentWidth():Number
    {
        return NaN;
    }
    
    /**
     * @private
     */
    public function set percentWidth(value:Number):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  right
    //----------------------------------
    
    /**
     * @private
     */
    public function get right():Object
    {
        return null;
    }
    
    /**
     * @private
     */
    public function set right(value:Object):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  top
    //----------------------------------
    
    /**
     * @private
     */
    public function get top():Object
    {
        return null;
    }
    
    /**
     * @private
     */
    public function set top(value:Object):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  verticalCenter
    //----------------------------------
    
    /**
     * @private
     */
    public function get verticalCenter():Object
    {
        return null;
    }
    
    /**
     * @private
     */
    public function set verticalCenter(value:Object):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  depth
    //----------------------------------
    
    /**
     * @private
     */
    public function get depth():Number
    {
        return 0;
    }
    
    /**
     * @private
     */
    public function set depth(value:Number):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  designLayer
    //----------------------------------
    
    /**
     * @private
     */
    public function get designLayer():DesignLayer
    {
        return null;
    }
    
    /**
     * @private
     */
    public function set designLayer(value:DesignLayer):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  is3D
    //----------------------------------
    
    /**
     * @private
     */
    public function get is3D():Boolean
    {
        return false;
    }
    
    //----------------------------------
    //  owner
    //----------------------------------
    
    /**
     * @private
     */
    public function get owner():DisplayObjectContainer
    {
        return null;
    }
    
    /**
     * @private
     */
    public function set owner(value:DisplayObjectContainer):void
    {
        // do nothing
    }
    
    //----------------------------------
    //  postLayoutTransformOffsets
    //----------------------------------
    
    /**
     * @private
     */
    public function get postLayoutTransformOffsets():TransformOffsets
    {
        return null;
    }
    
    /**
     * @private
     */
    public function set postLayoutTransformOffsets(value:TransformOffsets):void
    {
        // do nothing
    }
    
    //--------------------------------------------------------------------------
    //
    //  Variables
    //
    //--------------------------------------------------------------------------
    
    /**
     *  @private
