             
             if (testFlag(FLAG_TEXT_LINES_INVALID))
             {
-                // Remove the previous TextLines
-                // (and recycle them, if supported by the player).
+                // Remove/recycle the previous TextLines if we're going from
+                // locally managed textLines to TLF managed textLines or vice versa.
+                // Otherwise excess lines are recycled after the text is composed.
+                if (testFlag(FLAG_HTML_TEXT_SET))
+                {
+                    if (nextLineIndex > 0)
+                    {
+                        nextLineIndex = 0;
+                        removeExcessTextLines();
+                    }
+                }
+                else if (testFlag(FLAG_TEXT_SET))
+                {
+                    if (_htmlHelper)
+                        _htmlHelper.clearContainerChildren();
+                    _htmlHelper = null;
+               }
+               
                 _textWidth = 0;
                 _textHeight = 0;
                 clipWidth = 0;

            return preservingHTMLImporter;
        }
    }   
    
    /**
     *  @private
     */

                   if (!_htmlHelper.hostFormat)
                        createHostFormat();
                    
                    _htmlHelper.composeHTMLText(compositionWidth, compositionHeight);
                }
                else
                {
                    if (!elementFormat)
                        createElementFormat();  
                    
                    composeText(compositionWidth, compositionHeight); 
                }
                
                var origX:Number = x;
