      */
     public function setSelectionFormat(attributes:Object):void
     {
-        var containerFormat:ContainerFormat;
-        var paragraphFormat:ParagraphFormat;
-        var characterFormat:CharacterFormat;
-        
-        for (var p:String in attributes)
-        {
-            var kind:String = TextUtil.FORMAT_MAP[p];
-            
-            if (kind == TextUtil.CONTAINER)
+        // Switch to the EditManager.
+        var priorEditingMode:String =
+			getEditingMode(textFlow.interactionManager);
+        switchToEditingMode(textFlow, EditingMode.READ_WRITE);
+        
+        // Assign each specified attribute to one of three format objects,
+		// depending on whether it is container-, paragraph-,
+		// or character-level. Note that these can remain null.
+		var containerFormat:TextLayoutFormat;
+        var paragraphFormat:TextLayoutFormat;
+        var characterFormat:TextLayoutFormat;
+
+		// This internal TLF object maps the names of format properties
+		// to Property instances.
+		// Each Property instance has a category property which tells
+		// whether it is container-, paragraph-, or character-level.
+		var description:Object = TextLayoutFormat.tlf_internal::description;
+        
+		for (var p:String in attributes)
+        {
+            var category:String = description[p].category;
+            
+            if (category == Category.CONTAINER)
             {
                 if (!containerFormat)
-                   containerFormat =  new ContainerFormat();
+                   containerFormat =  new TextLayoutFormat();
                 containerFormat[p] = attributes[p];
             }
-            else if (kind == TextUtil.PARAGRAPH)
+            else if (category == Category.PARAGRAPH)
             {
                 if (!paragraphFormat)
-                   paragraphFormat =  new ParagraphFormat();
+                   paragraphFormat =  new TextLayoutFormat();
                 paragraphFormat[p] = attributes[p];
             }
-            else if (kind == TextUtil.CHARACTER)
+            else if (category == Category.CHARACTER)
             {
                 if (!characterFormat)
-                   characterFormat =  new CharacterFormat();
+                   characterFormat =  new TextLayoutFormat();
                 characterFormat[p] = attributes[p];
             }
         }
         
-        var priorEditingMode:String = getEditingMode(textFlow.interactionManager);
-        switchToEditingMode(textFlow, EditingMode.READ_WRITE);
-        
-        // Apply the format to the current selection.
+        // Apply the three format objects to the current selection.
         EditManager(textFlow.interactionManager).applyFormat(
-                        characterFormat, paragraphFormat, containerFormat);
+			characterFormat, paragraphFormat, containerFormat);
         
         // Restore the prior editing mode.
         switchToEditingMode(textFlow, priorEditingMode);

        }
        else
        {
            for each (p in names)
            {
                kind = TextUtil.FORMAT_MAP[p];

                if (kind == TextUtil.CONTAINER)
                    needContainerFormat = true;
                else if (kind == TextUtil.PARAGRAPH)
                    needParagraphFormat = true;
                else if (kind == TextUtil.CHARACTER)
                    needCharacterFormat = true;
            }
        }
        
        var containerFormat:IContainerFormat;
        var paragraphFormat:IParagraphFormat;
        var characterFormat:ICharacterFormat;
        
        if (needContainerFormat)
        {
            containerFormat =
                selectionManager.getCommonContainerFormat();
        }
        
        if (needParagraphFormat)
        {
            paragraphFormat =
                selectionManager.getCommonParagraphFormat();
        }

        if (needCharacterFormat)
        {
            characterFormat =
                selectionManager.getCommonCharacterFormat();
        }

        var format:Object = {};
        
        for each (p in names)
        {
            kind = TextUtil.FORMAT_MAP[p];
            
            if (kind == TextUtil.CONTAINER && containerFormat)
                format[p] = containerFormat[p];
            else if (kind == TextUtil.PARAGRAPH && paragraphFormat)
                format[p] = paragraphFormat[p];
            else if (kind == TextUtil.CHARACTER && characterFormat)
                format[p] = characterFormat[p];
        }
        

     *  and is updated by createTextFlow() when the hostFormatsInvalid flag
     *  is true.
     */
    private var hostTextLayoutFormat:TextLayoutFormat = new TextLayoutFormat();

    /**
     *  @private
