0 Replies Latest reply on Aug 17, 2006 6:24 PM by rhyeal

    Thumbnail and Image Gallery

    rhyeal
      I'm having some problems with this script. Mainly, nothing is happening. It is susposed to take the 9 boxes pre created, replace them with thumbnails, then allow clicking on those thumbnails to load a larger image into a bigger box. Alternatively, the images can be loaded via a next/prev button on the bottom. Here's the script.

      [code]
      /*Create 9 Boxes named bo0,bo1,bo2,bo3,bo4,bo5,bo6,bo7,bo8
      These 9 boxes load 9 thumbnails of images in array
      Have Images in same folder as thumbs
      Have instance called "loader"
      Have Next, Prev, First and Last Buttons
      Purpose: Load 9 Thumbnails, then when thumb is clicked, load larger image in "loader" box. Also allow loader to be loaded via a next/prev button.*/

      var box_array:Array = new Array("bo0","bo1","bo2","bo3","bo4","bo5","bo6","bo7","bo8");
      var num:Number = 0;
      var tot:Number = box_array.length;
      var timage_array:Array = new Array("timage_0.jpg","timage_1.jpg", "timage_3.jpg",...);
      var tcurnt:Number = 0;
      var image_array:Array = new Array("image_0.jpg","image_1.jpg", "image_3.jpg",...);
      var total:Number = image_array.length;
      var curnt:Number = 0;

      for (var num=0, num<tot, num++){
      box_array
      .load(timage_array[tcurnt]);
      tcurnt++;
      }

      bo0.onRelease {
      curnt = 0;
      loader.contentPath = image_array[curnt];
      loader.load();
      }

      next_btn.onRelease = function (){
      if(curnt < total){
      curnt++;
      load_image();
      }
      }
      prev_btn.onRelease = function(){
      if(curnt > 1){
      curnt--;
      load_image();
      }
      }

      first_btn.onRelease = function(){
      if(curnt != 0){
      curnt = 0;
      load_image();
      }
      }


      last_btn.onRelease = function(){
      if(curnt != total){
      curnt = total;
      load_image();
      }
      }

      function load_image():Void{
      loader.contentPath = image_array[curnt-1];
      loader.load();
      }
      [/code]


      Any ideas as to what is happening/not happening? I'm hoping for something like [url]http://www.afcomponents.com/img_gallery_thumb/[/url]. I also was wondering what I needed to code to preload each image individually with a load bar. Many thanks!