Dynamic Thumbnails and Dynamic Images

Sending variables to a function.

inveni0

I have a problem that is a bit difficult to describe, but I'll try my best.

I am building a custom thumbnail gallery. The application reads an xml file and populates thumbnails based on how many are provided in the xml script. This all works great.

My next step is to make the thumbnails clickable. When the user clicks the thumbnail, it should create a MovieClip from my library and load an image into a UILoader within that clip. My thumbnails and full size images are each loaded into XMLList variables. The index numbers match. This works, but with a flaw. The actionscript I have does not know which full image goes with which thumbnail. The code looks like this:

As you can see, the problem is that my variable 't' ages as each thumbnail is created. Now, when the user clicks a thumbnail, it attempts to load document.imageList[t], where 't' does not exist within my array of file names.

What I've been trying to do to solve this problem is pass a variable to the openImage function:

As you can see, I'm trying to openImage(t) on click, and then using saving that value of 't' as 'view' within the function openImage, so that, when creating the thumbnail, it's onClick event is registered with the appropriate image index number. But this doesn't work.

Any ideas? I feel like this brick wall is about to fracture my skull.

inveni0

2:06 am on Mar 1, 2009 (gmt 0)

Geez...did this forum die?

Anyhow, I crafted a work around. Basically, I hid a textfield in my thumbnail. Now, when it's created, I store the path to the full image in that text box. Then, within my onClick event, I use currentTarget to get the value of that text box.