             curObj = StyleProxy(curObj).source;
         }
         var target:DisplayObject = curObj as DisplayObject;
-        
-        // 4) Add type selectors 
-        var typeSelectors:Array = obj.getClassStyleDeclarations();
-        var n:int = typeSelectors.length;
-        for (var i:int = 0; i < n; i++)
-        {
-            var typeSelector:CSSStyleDeclaration = typeSelectors[i];
-            chain = typeSelector.addStyleToProtoChain(chain, target, filterMap);
-
-            if (typeSelector.effects)
-                obj.registerEffects(typeSelector.effects);
-        }
-
-        // 3) Add class selectors
+
+        var advancedObject:IAdvancedStyleClient = obj as IAdvancedStyleClient;
         var styleName:Object = obj.styleName;
-        if (styleName)
-        {
-            var classSelectors:Array = [];
-            
-            if (typeof(styleName) == "object")
-            {
-                if (styleName is CSSStyleDeclaration)
-                {
-                    // Get the style sheet referenced by the styleName property.
-                    classSelectors.push(CSSStyleDeclaration(styleName));
+        var styleDeclarations:Array;
+        var decl:CSSStyleDeclaration;
+
+        // If we have an advanced style client, we handle this separately
+        // because of the considerably more complex selector matches...
+        if (StyleManager.hasAdvancedSelectors() && advancedObject != null)
+        {
+            // Handle special case of styleName as a CSSStyleDeclaration
+            if (styleName is CSSStyleDeclaration)
+            {
+                styleDeclarations = [CSSStyleDeclaration(styleName)];
+            }
+
+            // Find matching style declarations, sorted by specificity
+            styleDeclarations = getMatchingStyleDeclarations(advancedObject, styleDeclarations);
+
+            // Then apply matching selectors to the proto chain
+            for (i = 0; i < styleDeclarations.length; i++)
+            {
+                decl = styleDeclarations[i];
+                if (decl)
+                {
+                    chain = decl.addStyleToProtoChain(chain, target, filterMap);
+                    if (decl.effects)
+                        obj.registerEffects(decl.effects);
+                }
+            }
+
+            // Finally, handle special case of styleName as an IStyleClient
+            // which overrides any of the selectors above
+            if (styleName is IStyleClient)
+            {
+                // If the styleName property is another UIComponent, then
+                // recursively add type selectors, class selectors, and
+                // inline styles for that UIComponent
+                chain = addProperties(chain, IStyleClient(styleName),
+                                      bInheriting);
+            }
+        }
+        else
+        {
+            // 4) Add type selectors 
+            styleDeclarations = obj.getClassStyleDeclarations();
+            var n:int = styleDeclarations.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                decl = styleDeclarations[i];
+                chain = decl.addStyleToProtoChain(chain, target, filterMap);
+    
+                if (decl.effects)
+                    obj.registerEffects(decl.effects);
+            }
+
+            // 3) Add class selectors
+            if (styleName)
+            {
+                styleDeclarations = [];
+                if (typeof(styleName) == "object")
+                {
+                    if (styleName is CSSStyleDeclaration)
+                    {
+                        // Get the style sheet referenced by the styleName property.
+                        styleDeclarations.push(CSSStyleDeclaration(styleName));
+                    }
+                    else
+                    {               
+                        // If the styleName property is another UIComponent, then
+                        // recursively add type selectors, class selectors, and
+                        // inline styles for that UIComponent
+                        chain = addProperties(chain, IStyleClient(styleName),
+                                              bInheriting);
+                    }
                 }
                 else
-                {               
-                    // If the styleName property is another UIComponent, then
-                    // recursively add type selectors, class selectors, and
-                    // inline styles for that UIComponent
-                    chain = addProperties(chain, IStyleClient(styleName),
-                                          bInheriting);
-                }
-            }
-            else
-            {
-                // Get the style sheets referenced by the styleName property             
-                var styleNames:Array = styleName.split(/\s+/);
-                for (var c:int=0; c < styleNames.length; c++)
-                {
-                    if (styleNames[c].length) {
-                        classSelectors.push(StyleManager.getStyleDeclaration("." + 
-                            styleNames[c]));
+                {
+                    // Get the style sheets referenced by the styleName property             
+                    var styleNames:Array = styleName.split(/\s+/);
+                    for (var c:int=0; c < styleNames.length; c++)
+                    {
+                        if (styleNames[c].length)
+                        {
+                            styleDeclarations.push(StyleManager.getStyleDeclaration("." + styleNames[c]));
+                        }
                     }
                 }
-            }
-
-            for (i = 0; i < classSelectors.length; i++)
-            {
-                var classSelector:CSSStyleDeclaration = classSelectors[i];
-                if (classSelector)
-                {
-                    chain = classSelector.addStyleToProtoChain(chain, target, filterMap);
-                    if (classSelector.effects)
-                        obj.registerEffects(classSelector.effects);
-                }
-            }
-        
-        }       
+
+                for (i = 0; i < styleDeclarations.length; i++)
+                {
+                    decl = styleDeclarations[i];
+                    if (decl)
+                    {
+                        chain = decl.addStyleToProtoChain(chain, target, filterMap);
+                        if (decl.effects)
+                            obj.registerEffects(decl.effects);
+                    }
+                }
+            }
+        }
 
         // 2) Add inline styles 
         if (obj.styleDeclaration)

                var decls:Object = StyleManager.getStyleDeclarations(type);
                if (decls)
                {
                    var matchingDecls:Array = getMatchingStyleDeclarations(decls, advancedObject);
                    classDecls = classDecls.concat(matchingDecls);
                }
            }

        // because of the considerably more complex selector matches...
        if (StyleManager.hasAdvancedSelectors() && advancedObject != null)
        {
            styleDeclarations = getMatchingStyleDeclarations(advancedObject, universalSelectors);

            n = styleDeclarations != null ? styleDeclarations.length : 0;
            for (i = 0; i < n; i++)
            {
                styleDeclaration = styleDeclarations[i];
                inheritChain = styleDeclaration.addStyleToProtoChain(inheritChain, uicObject);
                nonInheritChain = styleDeclaration.addStyleToProtoChain(nonInheritChain, uicObject);

                if (styleDeclaration.effects)
                    advancedObject.registerEffects(styleDeclaration.effects);
            }
        }
        // Otherwise we use the legacy Flex 3 logic for simple selectors.
