3 Replies Latest reply on May 16, 2011 3:11 PM by Peter Blazejewicz

    Fullscreen without contentscaling

    iamtoelli

      I'm Developing a Adobe Air application using Flash and i have a problem:

       

      Im trying to to make a "lightbox" looking application, what i want is for my application to be fullscreen with transparent backgroundColor and then center the "application" itslef in center.. like an "lightbox" if you familiar with webdevloping.

       

      I'v tryd making my application fullscreen but the problem then is that it also scales the content within my scene in flash .. i would like it to only affect the background width/height so it covers everything .. however that does not work so it drags my content in all directions so this obviusly dont work.

       

       

      What's the best way of making my application fade everything down in the background so you can see through it slightly and at the same time place pixel graphics in the center without it scaling it?

        • 1. Re: Fullscreen without contentscaling
          Joe ... Ward Level 4

          Set the stage scaleMode property to StageScaleMode.NO_SCALE. You might want to set the stage align property too.

          1 person found this helpful
          • 2. Re: Fullscreen without contentscaling
            iamtoelli Level 1

            Thanks alot! That did the jobb on the scaling part, however .. you dont happend to know how to set the background-color alpha from flash?

            • 3. Re: Fullscreen without contentscaling
              Peter Blazejewicz Level 4

              Hello,

               

              @iamtoelli

              are talking about AIR? So try below sample of "lightbox" (800x600 content panel centered on screen with semi-transparent background over screen content):

               

              in application window code:

               

               

               

              <?xml version="1.0" encoding="utf-8"?>

              <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

                                          xmlns:s="library://ns.adobe.com/flex/spark"

                                          xmlns:mx="library://ns.adobe.com/flex/mx"

                                          width="800" height="600"

                                          backgroundAlpha="0.90" backgroundColor="#000000"

                                          initialize="visible = false"

                                          creationComplete="setupStage();" >

                   <!-- -->

                   <fx:Script>

                        <![CDATA[

                             // setup stage align and maximize window

                             private function setupStage():void

                             {

                                  if(stage)

                                  {

                                       stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;

                                       stage.align = "";

                                  }

                                  this.nativeWindow.addEventListener(NativeWindowBoundsEvent.RESIZE, finishSetup);

                                  this.nativeWindow.maximize();

                             };

                             // when window is maximized show window on screen to avoid content flickering

                             private function finishSetup(resizeEvent:NativeWindowBoundsEvent):void

                             {

                                  this.nativeWindow.removeEventListener(NativeWindowBoundsEvent.RESIZE, finishSetup);

                                  this.visible = true;

                             }

                        ]]>

                   </fx:Script>

                   <s:Panel width="800" height="600" horizontalCenter="0" verticalCenter="0">

                        <s:controlBarContent/>

                   </s:Panel>

              </s:WindowedApplication>

               

              (snip on github: https://gist.github.com/975491  )

              in application descriptor system chrome is set to "none" and transparent to true (min size 800 600),

               

              hth,

              regards,

              Peter Blazejewicz