Storing values in multiple loops

for (var s = 0; s<mainSections.length; s++) { //grabbing the fabric types Handblocks,Screenprints,and Wovens

for (var i = 0; i<subSection.length; i++) { //grabbing each fabric design of the fabric type

for (var d = 0; d<matSection.length; d++) {//grabs each material type sub section of each fabric design

for (var t = 0; t<startThumbs.length; t++) {//finally processing the thumbs within the material type section.

I have these forloops going through an xml file. getting each section, sub section… eventually getting to the actuall fabric and thumbnail.

So in the last forloop is where I load the thumbs. When the person clicks a thumb I want to record the values of s i d… t I can store in a holder variable but the rest I dont know how to record.

Essentially I want to know what thumb the person clicked.

When you create your holder movie clip, you would set them all as properties of that clip. Something like:

var mc:MovieClip = createEmptyMovieClip(/*arguments*/);
mc.s = s;
mc.i = i;
mc.d = d;
mc.t = t;

I am not familiar with xml but I am assuming you are using xml in a flash movie? I would try this:

var clickedThumbs:Array = new Array();

for (var t = 0; t<startThumbs.length; t++) {    
    startThumbs[t].onRelease = function()    {
        clickedTumbs.push(this);
    }
}

[QUOTE=TheCanadian;2350841]When you create your holder movie clip, you would set them all as properties of that clip. Something like:

var mc:MovieClip = createEmptyMovieClip(/*arguments*/);
mc.s = s;
mc.i = i;
mc.d = d;
mc.t = t;

[/QUOTE]

thanks this worked. I didnt know s,i, and d were accessible from within the child forloop.

Glad to help :hoser: