this is actually a condensed and more exact problem im having,
I want to loop thru this array, and return the lexUrl value to
the targetURL, based on the currentImage value. right now im
doing if statements which I thought would work but it just keeps
coming out the array index [8] value. how would I construct a loop
that would do that??
var lexUrl:Array = new Array();
lexUrl[0] = “http://www.lexus.com/lexus-main/models/LS/”;
lexUrl[1] = “http://www.lexus.com/lexus-main/models/GS/”;
lexUrl[2] = “http://www.lexus.com/lexus-main/models/ES/”;
lexUrl[3] = “http://www.lexus.com/lexus-main/models/IS/”;
lexUrl[4] = “http://www.lexus.com/lexus-main/models/ISf/”;
lexUrl[5] = “http://www.lexus.com/lexus-main/models/SC/”;
lexUrl[6] = “http://www.lexus.com/lexus-main/models/LX/”;
lexUrl[7] = “http://www.lexus.com/lexus-main/models/GX/”;
lexUrl[8] = “http://www.lexus.com/lexus-main/models/RX/”;
currentImage = eventObject.data.number;
if (currentImage = 1) {
targetURL=lexUrl[0];
}
if (currentImage = 2) {
targetURL=lexUrl[1];
}
if (currentImage = 3) {
targetURL=lexUrl[2];
}
if (currentImage = 4) {
targetURL=lexUrl[3];
}
if (currentImage = 5) {
targetURL=lexUrl[4];
}
if (currentImage = 6) {
targetURL=lexUrl[5];
}
if (currentImage = 7) {
targetURL=lexUrl[6];
}
if (currentImage = 8) {
targetURL=lexUrl[7];
}
if (currentImage = 9) {
targetURL=lexUrl[8];
}
infoBtn.onRelease = function() {
getURL(targetURL, “_blank”);
}