Discussion Board

ask questions, discuss topics, solve problems

This is a public Discussion Area  publicRSS

Thread

    • Stage access issue
      Thread posted Oct 23 by Gabriel Ungureanu
      148 Views, 0 Comments
      Title:
      Stage access issue
      Content:

      Hey guys,

      I have a problem. I want to scale my Flex application using this:

      scaleFix() fires on applicationComplete.

                  private function scaleFix() : void {
                      this.stage.align = StageAlign.TOP_LEFT;
                      this.stage.scaleMode = StageScaleMode.EXACT_FIT;
                      this.addEventListener(ResizeEvent.RESIZE,updateScaling);
                  }
                 
                  private function updateScaling(evt : Event):void{
                      if(this.stage.stageWidth != width || this.stage.stageHeight != height){
                          var scaling:Number = 1;
                          if(width>height){
                              scaling = this.stage.stageWidth / width;
                          }else{
                              scaling = this.stage.stageHeight / height;
                          }
                          scaleX = scaleY = scaling;
                      }
                  }

      The problem is that this SWF is loaded in a container application using SWFLoader , and it changes the scaleX and scaleY of parent application, not on my current SWF. How could I access my current Stage ?

      Thanks.