Action Script Button Function Help
I'm having problems with the following script I'm using for an XML photo gallery.
for (i=0; i<49; i++) {
if (category[i] == "online") {
if (b<50) {
thumbbutton = this["a"+(b+1)];
thumbbutton.loadMovie(thumb[i], 1);
button = this["bt"+(i+1)];
button.onRollOver = function() {
company_txt.text = company[i];
description_txt.text = description[i];
url_txt.text = url[i];
};
}
b++;
}
}
The "i" variable works fine until it gets to the button.onRollOver function. I did a trace and "i" is always 49. It should never be 49 because the For loop should break at 49. Any suggestions as to why this is happening? I did a trace before the function, and I got 3 and 5 - there is the "online" tag at this position in the XML. Thanks!