 import flashx.tcal.elements.ParagraphElement;
 import flashx.tcal.elements.SpanElement;
 import flashx.tcal.elements.TextFlow;
+import flashx.tcal.formats.CharacterFormat;
+import flashx.tcal.formats.ContainerFormat;
 import flashx.tcal.formats.ICharacterFormat;
 import flashx.tcal.formats.IContainerFormat;
 import flashx.tcal.formats.IParagraphFormat;
+import flashx.tcal.formats.ParagraphFormat;
 
 import mx.graphics.graphicsClasses.TextFlowComposer;
 import mx.graphics.graphicsClasses.TextGraphicElement;

				    textFlow = createEmptyTextFlow();
			    }
            }

            // Build a textFlowTextFormat object which keeps track
            // of which text formats were specified on the TextFlow
            // as opposed to on the TextGraphic.
            // For example, if the 'content' were
            // <TextFlow fontSize="12">...</TextFlow>
            // then the textFlowTextFormat would be { fontSize: 12 }.
            
            var containerFormat:IContainerFormat =
                textFlow.containerFormat;
            var paragraphFormat:IParagraphFormat =
                textFlow.paragraphFormat;
            var characterFormat:ICharacterFormat =
                textFlow.characterFormat;
            
            for each (p in TextUtil.ALL_FORMAT_NAMES)
            {
                var kind:String = TextUtil.FORMAT_MAP[p];

                if (kind == TextUtil.CONTAINER &&
                    containerFormat != null &&
                    containerFormat[p] != null)
                {
                    textFlowTextFormat[p] = containerFormat[p];
                }
                else if (kind == TextUtil.PARAGRAPH &&
                         paragraphFormat != null &&
                         paragraphFormat[p] != null)
                {
                    textFlowTextFormat[p] = paragraphFormat[p];
                }
                else if (kind == TextUtil.CHARACTER &&
                         characterFormat != null &&
                         characterFormat[p] != null)
                {
                    textFlowTextFormat[p] = characterFormat[p];
                }
            }
        }

 		contentChanged = false;
		textChanged = false;

        // For each attribute whose value wasn't specified by the TextFlow,
        // apply the value from the TextGraphic.
        
        for each (p in TextUtil.ALL_FORMAT_NAMES)
        {
            if (!(p in textFlowTextFormat))
            {
            	var value:* = getStyle(p);
            	if (p == "tabStops" && value === undefined)
            		value = [];
            	textFlow[p] = value;
            }
         }
        
		return textFlow;
	}



    /**
     *  @private
     *  This object is determined by the CSS styles of the TextGraphic
     *  and is updated by createTextFlow() when the hostFormatsInvalid flag
     *  is true.
     */
    private var hostCharacterFormat:CharacterFormat = new CharacterFormat();

    /**
     *  @private
     *  This object is determined by the CSS styles of the TextGraphic
     *  and is updated by createTextFlow() when the hostFormatsInvalid flag
     *  is true.
     */
    private var hostParagraphFormat:ParagraphFormat = new ParagraphFormat();

    /**
     *  @private
     *  This object is determined by the CSS styles of the TextGraphic
     *  and is updated by createTextFlow() when the hostFormatsInvalid flag
     *  is true.
     */
    private var hostContainerFormat:ContainerFormat = new ContainerFormat();

	/**
	 *  @private
     *  This flag indicates whether hostCharacterFormat, hostParagraphFormat,
     *  and hostContainerFormat need to be recalculated from the CSS styles
     *  of the TextGraphic. It is set true by stylesInitialized() and also
     *  when styleChanged() is called with a null argument, indicating that
     *  multiple styles have changed.
	 */
    private var hostFormatsInvalid:Boolean = false;

	/**
	 *  @private
