     // For use in getConcatenatedMatrix function
     private static var fakeDollarParent:QName;
     private static var uiComponentClass:Class;
+    private static var uiMovieClipClass:Class;
     private static var usesMarshalling:Object;
     private static var lastModuleFactory:Object;
     private static var computedMatrixProperty:QName;
+    private static var $transformProperty:QName;
 
     //--------------------------------------------------------------------------
     //

        
        if (useComputedMatrix && computedMatrixProperty == null)
            computedMatrixProperty = new QName(mx_internal, "computedMatrix");
        
        while (displayObject && displayObject.transform.matrix && (!excludingRootSprite || displayObject != root))
        {            

                    // Get the class definition for UIComponent in the current ApplicationDomain
                    if (appDomain && appDomain.hasDefinition("mx.core.UIComponent"))
                        uiComponentClass = Class(appDomain.getDefinition("mx.core.UIComponent"));
                    // same thing for UIMovieClip
                    if (appDomain && appDomain.hasDefinition("mx.flash.UIMovieClip"))
                        uiMovieClipClass = Class(appDomain.getDefinition("mx.flash.UIMovieClip"));
                    
                    lastModuleFactory = moduleFactory;
                }
            }
            
            var isUIComponent:Boolean = uiComponentClass && displayObject is uiComponentClass;
            var isUIMovieClip:Boolean = uiMovieClipClass && displayObject is uiMovieClipClass;
            
            if (useComputedMatrix && isUIComponent)
                m.concat(displayObject[computedMatrixProperty]);
            else if (isUIMovieClip)
                m.concat(displayObject[$transformProperty].matrix);
            else
                m.concat(displayObject.transform.matrix);
            
