         
         // Capture device dpi and orientation
         var dpi:Number = dpiProvider.runtimeDPI;
-        var portraitOrientation:Boolean = stage.stageWidth < stage.stageHeight;
-        
-        var imageClass:Class = getImageClass(dpi, portraitOrientation);
+        var aspectRatio:String = (stage.stageWidth < stage.stageHeight) ? StageAspectRatio.PORTRAIT : StageAspectRatio.LANDSCAPE;
+        var imageClass:Class = getImageClass(dpi, aspectRatio);
         
         // The SplashImageClass will only be set if a splash screen image has
         // already be generated.  If the desired imageClass differs from the

    
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.display.StageOrientation;
import flash.events.Event;
import flash.events.StageOrientationEvent;

            m.scale(scaleX, scaleY);
        }

        // Move center to (0,0):
        m.translate(-width / 2, -height / 2);

        // Align center of image (0,0) to center of stage: 
        m.translate(stageWidth / 2, stageHeight / 2);

        // Apply matrix
        splashImage.transform.matrix = m;
