         
         if (!titleTextField)
         {
-            titleTextField = UITextField(createInFontContext(UITextField));
+            titleTextField = IUITextField(createInFontContext(UITextField));
             titleTextField.text = _title;
             titleTextField.styleName = getStyle("titleTextStyleName");
             titleTextField.enabled = true;
-            addChild(titleTextField);
+            addChild(DisplayObject(titleTextField));
         }
  
         if (!titleIconObject && _titleIcon)

import mx.controls.Button;
import mx.core.WindowedApplication;
import mx.core.IFlexDisplayObject;
import mx.core.IWindow;
import mx.core.mx_internal;
import mx.core.UIComponent;

    /**
     *  The UITextField in the title bar that displays the application title.
     */ 
    public var titleTextField:IUITextField;
    
    //----------------------------------
    //  window
