1 Reply Latest reply on Mar 10, 2008 6:05 AM by wouter vdb

    Fullscreen with Constrain Proportion

      how do i switch to Fullscreen with scale on. i have a AIR app with 800x600 but i need Fullscreen(Constrain Proportion) with the same dimensions. (like a Game)
        • 1. Re: Fullscreen with Constrain Proportion
          wouter vdb
          One way is to subclass Window and override updateDisplayList(). Use the unscaledWidth/Height parameters to obtain new values for the scaleX/Y properties of the (single) child inside the window. Consult the documentation set the window fullscreen.

          I.e. something like the following where 'view' is the child component.

          override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
          super.updateDisplayList(unscaledWidth, unscaledHeight);
          horizontalScrollPolicy = ScrollPolicy.OFF;
          verticalScrollPolicy = ScrollPolicy.OFF;
          var widthScale:Number = unscaledWidth / 800;
          var heightScale:Number = unscaledHeight / 600;
          var scale:Number = Math.min(widthScale, heightScale);
          view.scaleX = scale;
          view.scaleY = scale;