         var i:int;
 
         var uicObject:UIComponent = object as UIComponent;
-        
-        var classSelectors:Array = [];
+        var advancedObject:IAdvancedStyleClient = object as IAdvancedStyleClient;
+        var styleDeclaration:CSSStyleDeclaration = null;
+
+        var globalClassSelectors:Array = [];
         var styleName:Object = object.styleName;
         if (styleName)
         {
             if (styleName is CSSStyleDeclaration)
             {
-                // Get the style sheet referenced by the styleName property.
-                classSelectors.push(CSSStyleDeclaration(styleName));
+                // Get the styles referenced by the styleName property.
+                globalClassSelectors.push(CSSStyleDeclaration(styleName));
             }
             else if (styleName is IFlexDisplayObject || styleName is IStyleClient)
             {

               className != "mx.core.UITextField" &&
               className != "mx.graphics.graphicsClasses.GraphicElement")
        {
            var s:CSSStyleDeclaration;
            cache = StyleManager.typeSelectorCache[className];
            if (cache)
            {
                decls = decls.concat(cache);
                break;
            }

            s = StyleManager.getStyleDeclaration(className);
            
            if (s)
            {
                decls.unshift(s);
                // We found one so the next set define the selectors
                // for this found class and its ancestors.
                // Save the old list and start a new list.
                classNames.push(className);
                caches.push(classNames);
                declcache.push(decls);
                decls = [];
                classNames = [];
            }
            else
            {
                classNames.push(className);
            }

            try

            }
        }

        caches.push(cacheKeys);
        declcache.push(decls);
        decls = [];

        while (caches.length)
        {
            cacheKeys = caches.pop();
            decls = decls.concat(declcache.pop());
            while (cacheKeys.length)
            {
                StyleManager.typeSelectorCache[cacheKeys.pop()] = decls;
            }
        }

