5 Replies Latest reply on Jan 18, 2011 9:07 PM by kglad

    min stage width

    dannyb89

      hi guys

       

      am i doing something wrong becasue i have set a min stage size and when my window gets to that size it is meant to stop scaling the flash movie, however it doesnt :(

       

      any help would be great

       

      // Setup the Stage properties
      Stage.scaleMode = "noScale";
      Stage.align = "TL";
      // Variables (in pixels)
      //var headHeight:Number = 100;
      //var footHeight:Number = 50;
      // Variables (in percent)
      var leftColWidth:Number = 10;
      var mainColWidth:Number = 60;
      var rightColWidth:Number = 30;
      // Prototype function to position MovieClips
      MovieClip.prototype.pos = function(x, y, w, h) {
          this._x = x;
          this._y = y;
          this._width = w;
          this._height = h;
      };
      //set leftCol colour
      var colorful = new Color("_root.leftCol");
      colorful.setRGB(0x000000);

       

      //set leftCol colour
      var colorful = new Color("_root.mainCol");
      colorful.setRGB(0xffffff);

       

      //set leftCol colour
      var colorful = new Color("_root.rightCol");
      colorful.setRGB(0xc00743);

       

      //set min stage
      var minWidth = 1024;
      var minHeight = 768;

       

      function onResizeMe()
      {
          if(Stage.width <= 1024)
          {
              trace("stage too small");
              stage.width = 1024;
          }
          if(Stage.height <= 768)
          {
             trace("stage too small");
             stage.height = 1024;
          }
      }

       

      // Out main function
      function setStage() {

       

          var sw:Number = Stage.width;
          var sh:Number = Stage.height;
          // Calculate percentages based on Stage dimensions
          var Lw:Number = sw/100*leftColWidth;
          var Mw:Number = sw/100*mainColWidth;
          var Rw:Number = sw/100*rightColWidth;
          //var Hp:Number = sh - (headHeight + footHeight);
          // Position / resize our MovieClips
          //header.pos (0, 0, sw, headHeight);
          leftCol.pos(0,0,Lw,sh);
          mainCol.pos(Lw,0,Mw,sh);
          rightCol.pos(Lw+Mw,0,Rw,sh);
          foliage_mc.pos(Lw+Mw,sh,470,400);
          menu_mc.pos(Lw+Mw+20,((sh/100)*10));
          //footer.pos (0, sh - footHeight, sw, footHeight);
          onResizeMe();
      }
      // Add a listener
      var stageListener:Object = new Object();
      Stage.addListener(stageListener);
      // When the Stage dimensions change...
      stageListener.onResize = setStage;
          // Call our function to set it all up right!
      setStage();

       

      http://www.jta.co.uk - similar to this please