         obj.scaleX /= ratio;
         obj.scaleY /= ratio;
 
-        if (obj is Application)
+        if ((applicationClass && obj is applicationClass) || 
+            (fxApplicationClass && obj is fxApplicationClass))
         {
             if (!isNaN(appExplicitWidth)) //&& !isNaN(appExplicitHeight))
             {


        var appExplicitWidth:Number;
        var appExplicitHeight:Number;

        if (obj is Application)
        {
            // The following loop is required only for scenario where 
            // application may have a few children with percent
            // width or height.
            n = Application(obj).numChildren
            for (i = 0; i < n; i++)
            {
                child = IFlexDisplayObject(Application(obj).getChildAt(i));
                
                if (child is UIComponent &&
                    (!isNaN(UIComponent(child).percentWidth) ||

import flash.geom.Rectangle;
import flash.printing.PrintJob;
import flash.printing.PrintJobOptions;
import mx.core.IFlexDisplayObject;
import mx.core.IUIComponent;
import mx.core.UIComponent;
