3 Replies Latest reply on Feb 26, 2011 8:09 AM by kglad

    scaleContent

    michaeltowse Level 1

      Can anyone shed any light on why the dynamic MCs which I am loading up always fail to scale...

       

      I've tried everything and feel like i'm going round in circles!

       

      Any help would be appreciated.

       

      Mike

       

      import mx.controls.Loader;
      var theLoader = Loader(createClassObject(Loader, "container", 1));
      theLoader.scaleContent = true;
      theLoader.setSize(1*50,1*50);
      theLoader.move(411,70);
      //var mc1:MovieClip = theLoader.content;
      var _currentMovieNum:Number = 1;
      p = "flashes/";
      var mc1:MovieClipLoader = new MovieClipLoader();
      var list:Object = new Object();
      list.onLoadInit = function(mc1:MovieClip) {
          playMovie();
      };
      mc1.addListener(list);
      function loadSWF() {
          mc1.loadClip(p+flashArray[_currentMovieNum],container);
      }
      function playMovie() {
          this.onEnterFrame = function() {
              if (container._currentframe>=container._totalframes) {
                  _currentMovieNum++;
                  loadSWF();
                  delete this.onEnterFrame;
              }
          };
      }
      loadSWF();
      function runSingle(i:Number) {
          mc1.unloadClip(container);
          delete loadSWF;
          loadMovie(p+flashArray[i], "container");
      }
      
      
      
        • 1. Re: scaleContent
          kglad Adobe Community Professional & MVP

          use:

           


          // if you don't have a movieclip named container already created use the below line
          //var container:MovieClip=this.createEmptyMovieClip("container",this.getNextHighestDepth())
          var _currentMovieNum:Number = 1;
          p = "flashes/";
          var mc1:MovieClipLoader = new MovieClipLoader();
          var list:Object = new Object();
          list.onLoadInit = function(mc:MovieClip) {
              playMovie();
          // resize mc here
          }; mc1.addListener(list); function loadSWF() {     mc1.loadClip(p+flashArray[_currentMovieNum],container); } function playMovie() {     this.onEnterFrame = function() {         if (container._currentframe>=container._totalframes) {             _currentMovieNum++;
                      loadSWF();             delete this.onEnterFrame;         }     }; } loadSWF(); function runSingle(i:Number) {     mc1.unloadClip(container);     delete loadSWF;     loadMovie(p+flashArray[i], "container"); }
          • 2. Re: scaleContent
            michaeltowse Level 1

            Thanks for the support kglad, but i was hoping to use the scaleContent function due for my dynamic clips. They are vary slightly in size and didn't want to put in a specific size for each one. Will that above work?

            • 3. Re: scaleContent
              kglad Adobe Community Professional & MVP

              that's no problem.  your resizing will be based on _currentMovieNum.