 	mx_internal function addTextLines(container:DisplayObjectContainer,
 								      index:int = 0):void
 	{
-		var n:int = mx_internal::textLines.length;
+		var n:int = textLines.length;
         if (n == 0)
             return;
 
+        var addChildAtMethod:Function = container is UIComponent ?
+        								UIComponent(container).$addChildAt :
+        								container.addChildAt;
+            
         for (var i:int = n - 1; i >= 0; i--)
 		{
-			var textLine:DisplayObject = mx_internal::textLines[i];
+			var textLine:DisplayObject = textLines[i];
 						
             //trace(container.name, "addTextLines", textLine.x, textLine.y, drawX, drawY);
 
             textLine.x += drawX;
             textLine.y += drawY;
             
-			if (container is IVisualElementContainer)
-                IVisualElementContainer(container).mx_internal::$addChildAt(textLine, index);
-			else
-                container.addChildAt(textLine, index);
+			addChildAtMethod(textLine, index);
 		}
 		
 		// If these lines went into a shared container these need to be saved

        // The updateDisplayList() method of a GraphicElement can get called
        // when its style chain hasn't been initialized.
        // In that case, composeTextLines() must not be called.
        if (!mx_internal::styleChainInitialized)
            return;

        // Figure out if a compose is needed or maybe just clip what is already

        // object.  Once it's in it's own display object leave it there.
        if (clipText)
        {
            alwaysCreateDisplayObject = true;
            if (sharedIndex > 0)
                return;
        }
        
        //trace(id, drawnDisplayObject.name, "udl", "compose", compose, "clip", 
        //      clipText, "bounds", bounds);        

        // Set the scrollRect used for clipping appropriately.              
        clip(clipText, unscaledWidth, unscaledHeight);
    }
            
    /**
     *  @private
     */
    override protected function setDisplayObject(value:DisplayObject):void
    {        
        if (displayObject == value)
            return;

        // There is an exisiting d.o. so this element is either being moved
        // to a different container (value != null) or it is being removed 
        // (value == null).
        if (displayObject)
        {
            // If there was a scroll rect remove it before we lose the reference
            // to the display object. 
            clip(false, 0, 0);
        
            displayObjectChanged = true;        
            invalidateProperties();
        }
             
        super.setDisplayObject(value);
    }    
  
    /**
     *  @private
     */
    override mx_internal function doUpdateDisplayList():void
    {
		super.doUpdateDisplayList();
		
		if (visibleChanged)
		{
			visibleChanged = false;
			
			var n:int = textLines.length;
			for (var i:int = 0; i < n; i++)
			{
				textLines[i].visible = visible;
			}
		}
    }

    //--------------------------------------------------------------------------
    //
    //  Methods: ISimpleStyleClient
