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

    Fullscreen without contentscaling


      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
              blazejewicz Level 4




              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"



                                          width="800" height="600"

                                          backgroundAlpha="0.90" backgroundColor="#000000"

                                          initialize="visible = false"

                                          creationComplete="setupStage();" >

                   <!-- -->



                             // setup stage align and maximize window

                             private function setupStage():void




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

                                       stage.align = "";


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



                             // 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;




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





              (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),




              Peter Blazejewicz