     import flash.text.engine.TextLineValidity;
     import flash.utils.Dictionary;
     
+    import mx.managers.SystemManager;
+    import mx.managers.SystemManagerGlobals;
+    
+    import spark.utils.TextUtil;
+    
     import flashx.textLayout.compose.ISWFContext;
     import flashx.textLayout.compose.TextLineRecycler;
     import flashx.textLayout.formats.ITextLayoutFormat;

        //  Variables
        //
        //--------------------------------------------------------------------------
        
        /**
         *  @private

                
                if (testFlag(FLAG_HTML_TEXT_SET))
                {
                    // if switching composers, remove all existing textlines.
                    // the html composer assumes existing textlines belonged
                    // to the flow
                    if (lastComposeWasText)
                    {
                        nextLineIndex = 0;
                        removeExcessTextLines();
                    }
                    lastComposeWasText = false;

                    if (!_htmlHelper.hostFormat)
                        createHostFormat();
                    
                    _htmlHelper.composeHTMLText(compositionWidth, compositionHeight);
                }
                else
                {
                    if (!lastComposeWasText)
                    {
                        nextLineIndex = 0;
                        removeExcessTextLines();
                    }
                    
                    lastComposeWasText = true;
                    if (!elementFormat)
                        createElementFormat();  
                    
