1 Reply Latest reply on Jul 4, 2013 6:10 AM by kglad

    how to load 2 xml galleries in single function loop.

    Emraan.Khan

      how to load 2 xml galleries in single function loop.

      my function is--------

       

      var myGalleryXML = new XML();

      myGalleryXML.ignoreWhite = true;

      myGalleryXML.load("gallery.xml");

       

       

      function callThumbs()

      {

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

          wall._x = _root.gallery_x;

          wall._y = _root.gallery_y;

          wall.addEventListener(MouseEvent.CLICK);

       

          var clipLoader = new MovieClipLoader();

          var preloader = new Object();

          clipLoader.addListener(preloader);

         

       

              for (i =0; i <6; 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 = -3100 + (i-j) * 765;

             

       

         clipLoader.loadClip("shop/" + thumbURL,myThumb_mc);  // i want to load this  by xml gallery "gallery1.xml"

       

       

      preloader.onLoadStart = function(target)

              {

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

                  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;

                  };

       

              };

         

         

          }

         

       

       

          for (i = 0; i < 6; 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 = -7210 + (i-j) * 765;

              myThumb_mc._y = _root.thumb_position = 180;

       

              clipLoader.loadClip("banner/" + thumbURL,myThumb_mc);  // i want to load this  by xml gallery "gallery2.xml"

       

       

              preloader.onLoadStart = function(target)

              {

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

                  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;

                  };

       

              };

          }

       

      }