             var styleModule:IStyleModule =
                 IStyleModule(moduleEvent.module.factory.create());
             
+            // Register the style module to use this style manager.
+            moduleEvent.module.factory.registerImplementation("mx.styles::IStyleManager2", instance);
+            if ("setStyleDeclarations" in styleModule)
+                styleModule["setStyleDeclarations"](instance);
             styleModules[moduleEvent.module.url].styleModule = styleModule;
             
             if (update)

                n = Number("0x" + colorName.slice(1));
                return isNaN(n) ? StyleManager.NOT_A_COLOR : uint(n);
            }

            if (colorName.charAt(1) == "x" && colorName.charAt(0) == '0')
            {
                // Map "#77EE11" to 0x77EE11
                 n = Number(colorName);
                return isNaN(n) ? StyleManager.NOT_A_COLOR : uint(n);
            }

            // Map "red" or "Red" to 0xFF0000;
            // Map "haloGreen" or "HaLoGrEeN" to 0x46FF00.
            var c:* = colorNames[colorName.toLowerCase()];
            if (c === undefined)
                return StyleManager.NOT_A_COLOR;

            return uint(c);
        }

        return uint(colorName);
    }


     *  The <code>isInheritingTextFormatStyle()</code> method queries this set.
     */
    private static var inheritingTextFormatStyles:Object =
        {
            align: true,
            bold: true,
            color: true,
            font: true,
            indent: true,
            italic: true,
            size: true
        };
    
    /**
     *  @private
     *  Set of styles for which setStyle() causes
