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

            }
            else if (styleName is String)
            {
                // Get the style sheets referenced by the styleName property             
                var styleNames:Array = styleName.split(/\s+/);
                n = styleNames.length;
                for (i = 0; i < n; i++)
                {
                    if (styleNames[i].length)
                    {
                        classSelectors.push(
                            StyleManager.getStyleDeclaration("." + styleNames[i]));
                    }
                }
            }


        var className:String = getQualifiedClassName(object)
        className = className.replace("::", ".");

        var advancedObject:IAdvancedStyleClient = object as IAdvancedStyleClient;

        var cacheKey:String = advancedObject ? getAdvancedCacheKey(className, advancedObject) : className;
        var cache:Array = StyleManager.typeSelectorCache[cacheKey];
        if (cache)
           return cache;

        var decls:Array = [];
        var cacheKeys:Array = [];
        var caches:Array = [];
        var declcache:Array = [];

