0 Replies Latest reply on Jun 6, 2007 9:10 AM by samwisemcganji

    Picture Gallery

    samwisemcganji
      Hello,

      I have created a picture gallery in flash using mainly actionscript. The gallery worked perfectly, there are 8 thumbnails on stage when one is pressed a masked movieclip moves up or down untill it reaches the required image relating to the thumbnail. The images are created and exported for actionscript but are not place on the stage. That is done by creating an empty movieclip using script and placing the images in a vertical column in the movieclip.

      The problem came when I wanted to add a sperate feature of a text box which displays information about the image you are seeing. I created 8 title_box mc's. and used the same code and attached them to the stage in the same way the images were. Although when it runs it is fine but the images do the same as the text dispite me changing all the variables. So the txet scrolls up and down as do the images but the images scroll to the xy value the text is using. I have looked at the co0de for hours now and just cant understand why. Any help would be appreciated.

      I am obviously doing something stupid but just cant see it.

      this.createEmptyMovieClip("images", 100);
      this.attachMovie("mask", "mask", 101);
      mask._x = images._x =200;
      mask._y = target = 40;
      images.setMask(mask);
      images._y = -1000;
      speed = 5;

      this.createEmptyMovieClip("title", 110);
      this.attachMovie("title_mask", "title_mask", 111);
      title_mask._x = title._x =200;
      title_mask._y = targetb = 340;
      title.setMask(title_mask);
      title._y = -100;
      speed = 5;

      for (var i = 0; i<8; i++)
      { var img = images.attachMovie("image_"+i, "images_"+i, i);
      img._y = img._height*i;
      var thumb = this["thumb_"+i];
      thumb.pos = target+(i*-img._height);
      }

      for (var t = 0; t<8; t++)
      { var tit = title.attachMovie("title_"+t, "title_"+t, t);
      tit._y = tit._height*t;
      var thumb = this["thumb_"+t];
      thumb.pos = targetb+(t*-tit._height);

      thumb._alpha = 60;

      thumb.onPress = function() {
      target = this.pos;
      targetb = this.pos;
      };
      thumb.onRollOver = function() {
      this._alpha = 30;
      };
      thumb.onRollOut = function() {
      this._alpha = 60;
      };
      }


      this.onEnterFrame = function() {
      images._y += (target-images._y)/speed;
      title._y += (targetb-title._y)/speed;
      };