1 Reply Latest reply on Jun 19, 2013 3:37 AM by kglad

    I want to space between thumb... which is calling by "gallery.xml"

    Emraan.Khan

      function callThumbs() {           

       

          _root.createEmptyMovieClip("wall",_root.getNextHighestDepth());

          wall._x = _root.gallery_x= 0;

          wall._y = _root.gallery_y= 340;

       

       

       

      wall.addEventListener(MouseEvent.CLICK);

       

       

       

          var clipLoader = new MovieClipLoader();

          var preloader = new Object();

          clipLoader.addListener(preloader);

       

       

          /**/

       

          for (i=0; i<15; i++) {

              thumbURL = myImages[i].attributes.thumb_url;

       

              myThumb_mc = wall.createEmptyMovieClip(i, wall.getNextHighestDepth());

              myThumb_mc._x = _root.thumb_height*i;

              myThumb_mc._x = _root.thumb_position=-2000;

       

              clipLoader.loadClip("thumbs/"+thumbURL,myThumb_mc);

       

       

              preloader.onLoadStart = function(target) {

                  target.createTextField("my_txt",target.getNextHighestDepth(),0,0,10,1 0);

                  target.my_txt.selectable = false;

              };

       

       

              preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {

                  target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);

              };

       

              preloader.onLoadComplete = function(target) {

                  new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);

                  target.my_txt.removeTextField();

                  target.onRelease = function() {

                      callFullImage(this._name);

       

                  };

       

       

       

                  target.onRollOver = function() {

                      this._alpha = 100;

                  };

       

                  target.onRollOut = function() {

                      this._alpha = 100;

                  };

       

              };

          }

      }

        • 1. Re: I want to space between thumb... which is calling by "gallery.xml"
          kglad Adobe Community Professional & MVP

          use:

           

           

          var gapX:Number=5;

          var nextX:Number = 0;

          var loadNum:Number=0;

          var preloader:Object={};

          var clipLoader:MovieClipLoader=new MovieClipLoader();

          clipLoader.addListener(preloader);

          function callThumbs() {           

           

              _root.createEmptyMovieClip("wall",_root.getNextHighestDepth());

              wall._x = _root.gallery_x= 0;

              wall._y = _root.gallery_y= 340;

           

          //wall.addEventListener(MouseEvent.CLICK);

              //var clipLoader = new MovieClipLoader();

              //var preloader = new Object();

              //clipLoader.addListener(preloader);

              /**/

          loadnextF();

          }

          function loadnextF(){

              thumbURL = myImages[loadNum].attributes.thumb_url;

                  myThumb_mc = wall.createEmptyMovieClip(loadNum, wall.getNextHighestDepth())

          myThumb_mc._alpha=0;

                  clipLoader.loadClip("thumbs/"+thumbURL,myThumb_mc);

          }

           

                  preloader.onLoadStart = function(target) {

                      target.createTextField("my_txt",target.getNextHighestDepth(),0,0,10,1 0);

                      target.my_txt.selectable = false;

                  };

           

           

                  preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {

                      target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);

                  };

           

                  preloader.onLoadComplete = function(target) {

          target._x = nextX;

          nextX += target._width+gapX;

          loadNum++;

          if(loadNum<15){

          loadnextF();

          } else {

          // all images loaded.  do whatever.

          }

                      new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);

                      target.my_txt.removeTextField();

                      target.onRelease = function() {

                          callFullImage(this._name);

           

                      };

           

           

           

                      target.onRollOver = function() {

                          this._alpha = 100;

                      };

           

                      target.onRollOut = function() {

                          this._alpha = 100;

                      };

           

                  };