0 Replies Latest reply on Dec 4, 2006 2:01 PM by FlexMcGee6000

    Dynamic Image click handler HELP

      Hi - I was wondering if anyone could help. Basically, I am loading in a list of images from a database dynamically using amfphp. For example, when you click on an item, it brings up a window that loads 1 main image and multiple smaller thumbnails on the fly. I am trying to implement a button behavior on the thumbnails to change the source of the main image to match the thumbnail that was clicked.

      Here I am looping through the results and creating the images:
      for each(var current:Object in result_arr)
      var tmp:ImageImproved = new ImageImproved(main_image);
      tmp.source = current.src;
      tmp.width = 100;
      tmp.visible = true;
      tmp.buttonMode = true;
      main_image.source = result_arr[0].src;

      I then set the source of the main image to the source of the first thumbnail. By the way ImageImproved is just a class that extends the normal image class. I thought I could use mouseClick event handler for the created image to change the source but I didn't have any luck.

      If anyone has any advice at all, it would be helpful. This is driving me crazy!