0 Replies Latest reply on Jul 2, 2006 10:23 AM by skazaand

    moving extern thumbs

    skazaand
      Hi, the thumbs in the gallery are extern, so are the pictures.
      I have a problem, couse i wanna slide thumbs up and down with mouse position,
      and i used a script with dragger, which i made unvisible. Problem occour becouse mouse position is not active over thumbs, and then the speed of moving thumbs is uncontroled, becouse dragger jumbs on active mouse position. Also there somethimes thumbs are sliding, when mouse in not rollover the square. On the site i made dragger visible.
      Please hand me the solution..

      http://users.triera.net/skazaand/antest_2.html

      (only first 2 gallery work)


      [B scrpit on the mask:



      th_nav.setMask(theMask);
      csillapitas = 85;
      pos = 0;
      dragger._x = theMask._width-4;
      dragger.onrollover = function() {
      startDrag(this, false, _xmouse, 0, _xmouse, _ymouse);
      mehet();
      };
      dragger.onRollout = dragger.onReleaseOutside=function () {
      stopDrag();
      };
      function mehet() {
      th_nav.onEnterFrame = function() {
      tavolsag = (this._height-(theMask._height/1.3))/(theMask._height-dragger._height);
      pos = -dragger._y*tavolsag;
      this._y -= (this._y-pos)/csillapitas;
      };
      }


      gallery script :

      var tnNr;
      spacing = 10;
      container._alpha = 0;
      var curLength;
      MovieClip.prototype.loadPic = function(pic, id) {
      info.text = "";
      this._alpha = 0;
      this.loadMovie(pic);
      temp = this._parent.createEmptyMovieClip("temp2", 998);
      temp.onEnterFrame = function() {
      var t = container.getBytesTotal(), l = container.getBytesLoaded();
      if (Math.round(l/t) == 1 && container._width != 0 && container._height != 0) {
      var w = container._width+spacing, h = container._height+spacing;
      border.resizeMe(w, h, id);
      delete this.onEnterFrame;
      }
      };
      };
      MovieClip.prototype.resizeMe = function(w, h, id) {
      var speed = 2;
      container._alpha = 0;
      this.onEnterFrame = function() {
      this._width += (w-this._width)/speed;
      this._height += (h-this._height)/speed;
      if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
      this._width = w;
      this._height = h;
      container._x = this._x-this._width/2+spacing/2;
      container._y = this._y-this._height/2+spacing/2;

      container._alpha += 30;
      if (container._alpha>90) {
      info.text = id;
      container._alpha = 100;
      delete this.onEnterFrame;
      }
      }
      };
      };
      function galleryChoice(q) {
      pArray = new Array();
      tArray = new Array();
      iArray = new Array();
      my_xml = new XML();
      for (var j = 0; j<curLength; j++) {
      this.scroll.th_nav["thmb"+j].removeMovieClip();
      }
      my_xml.ignoreWhite = true;
      my_xml.onLoad = function(loaded) {
      if (loaded) {
      gallery = this.firstChild.childNodes
      quote:

      ;
      curLength = gallery.childNodes.length;
      for (var i = 0; i<gallery.childNodes.length; i++) {
      pArray.push(gallery.childNodes.attributes.source);
      tArray.push(gallery.childNodes.attributes.thumb);
      iArray.push(gallery.childNodes.attributes.title);
      }
      }
      delay = setInterval(makeButtons, 50);
      };
      my_xml.load("gal1.xml");
      }
      function makeButtons() {
      tnNr = 0;
      clearInterval(delay);
      for (var i = 0; i<tArray.length; i++) {
      var thb = scroll.th_nav.thmb.duplicateMovieClip("thmb"+i, 1000+i);
      thb.id = i;
      // tukaj je stevilo 1*50 stevilo oken ----------------------------------------------------------------------------------------- -----------
      // -------------------------------------------- -------------------------------------------- ----------------------------------------------
      thb._x = i%1*50;
      thb._y = Math.floor(i/1)*53;
      }
      loadButtons();
      }
      function loadButtons() {
      var tbox = scroll.th_nav["thmb"+tnNr].box;
      tbox.loadMovie(tArray[tnNr]);
      temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
      temp.onEnterFrame = function() {
      bt = tbox.getBytesTotal();
      bl = tbox.getBytesLoaded();
      if (bt == bl && bt>4) {
      nextButton();
      delete this.onEnterFrame;
      }
      };
      }
      function nextButton() {
      if (tnNr<tArray.length-1) {
      tnNr++;
      loadButtons();
      } else {
      activateButtons();
      }
      }
      function activateButtons() {
      mainButtons();
      for (var i = 0; i<pArray.length; i++) {
      var but = scroll.th_nav["thmb"+i];
      but.id = i;
      but.onRelease = function() {
      container.loadPic(pArray[this.id], iArray[this.id]);
      disButtons2(this.id);
      };
      }
      container.loadPic(pArray[0], iArray[0]);
      disButtons2(0);
      }

      function disButtons2(d) {
      for (var i = 0; i<tArray.length; i++) {
      // obarvanje thumbnailov ... prvi so prikazani, drug je aktivni
      //---------------------------------------------------------------------------------------- ----------------------
      if (i != d) {
      this.scroll.th_nav["thmb"+i].enabled = 1;
      this.scroll.th_nav["thmb"+i].box._alpha = 100;
      } else {
      this.scroll.th_nav["thmb"+i].enabled = 0;
      this.scroll.th_nav["thmb"+i].box._alpha = 40
      ;
      }
      }
      }
      function disButtons(d) {
      for (var i = 0; i<butArray.length; i++) {
      if (i != d) {
      this[butArray].enabled = 1;
      this[butArray].gotoAndStop(1);
      } else {
      this[butArray].enabled = 0;
      this[butArray].gotoAndStop(2);
      }
      }
      }
      disButtons(0);
      galleryChoice(0);